Backup directory structure only - no files

In rsync I would do the following to sync only the dirs of source to target

rsync -av -f"+ */" -f"- *" source target

What would be the equivalent in the filters file?

Bonus question - can duplicacy be used to also replicate file names but not the contents?

I can use find and output to a file to capture something similar but was hoping to align on using duplicacy for all my sync and backup needs.

These 2 filter rules should do the job:

+*/
-*

The first rule includes all directories while the second one exclude anything else.

I don’t think there is a way to do that.

1 Like

Thanks for confirming the filter settings. As it’s “just” a dir listing I decided the added benefit of doing that via duplicacy is outweighed by being able to simply view the dir structure in a file browser.

I hacked together the following to do that, sure there is a way to avoid the temp text file but not quite figured that one out yet.

#!/usr/bin/env bash

extime=$(date +%Y%m%d-%H%M%S)
tempfile=listing-$extime.txt

mkdir -p /volume2/duplicacy/plexmedia/
rsync -av -f"+ */" -f"- *" --delete --delete-excluded /volume1/plexmedia/ /volume2/duplicacy/plexmedia/

find /volume1/plexmedia -maxdepth 3 -type f | sort | sed 's/volume1/volume2\/duplicacy/' > /volume1/homes/phillipmcmahon/$tempfile

while read p; do touch "$p"; done < /volume1/homes/phillipmcmahon/$tempfile
#rm /volume1/homes/phillipmcmahon/$tempfile

rsync -av -f"+ */" -f"- *" /volume1/plexmedia/ /volume2/duplicacy/plexmedia/

chown -R phillipmcmahon:users /volume2/duplicacy/plexmedia

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.