This is what I just did as a proof of concept:
Create a bunch of files
mkdir -p in/{1,2,3}/{1,2,3}/ out
touch in/{1,2,3}/{1,2,3}/randomfile.txt
touch in/{1,2,3}/{1,2,3}/this_i_want.txt
touch in/{1,2,3}/{1,2,3}/this_i_want_as_well.txt
touch in/{1,2,3}/{1,2,3}/not_this.txt
touch in/{1,2,3}/randomfile.txt
touch in/{1,2,3}/this_i_want.txt
touch in/{1,2,3}/this_i_want_as_well.txt
touch in/{1,2,3}/not_this.txt
find in -type f -exec dd if=/dev/urandom of={} bs=1k count=1 \;
add a filter file like so
+*/
+*/*want*.txt
Run backup and observe that only files I want get picked up and none that I don’t, from the whole directory structure:
% dpl backup -dry-run
Storage set to /tmp/out
No previous backup found
Indexing /tmp/in
Parsing filter file /tmp/in/.duplicacy/filters
Loaded 2 include/exclude pattern(s)
Packed in/1/this_i_want.txt (1024)
Packed in/1/this_i_want_as_well.txt (1024)
Packed in/1/1/this_i_want.txt (1024)
Packed in/1/1/this_i_want_as_well.txt (1024)
Packed in/1/2/this_i_want.txt (1024)
Packed in/1/2/this_i_want_as_well.txt (1024)
Packed in/1/3/this_i_want.txt (1024)
Packed in/1/3/this_i_want_as_well.txt (1024)
Packed in/2/this_i_want.txt (1024)
Packed in/2/this_i_want_as_well.txt (1024)
Packed in/2/1/this_i_want.txt (1024)
Packed in/2/1/this_i_want_as_well.txt (1024)
Packed in/2/2/this_i_want.txt (1024)
Packed in/2/2/this_i_want_as_well.txt (1024)
Packed in/2/3/this_i_want.txt (1024)
Packed in/2/3/this_i_want_as_well.txt (1024)
Packed in/3/this_i_want.txt (1024)
Packed in/3/this_i_want_as_well.txt (1024)
Packed in/3/1/this_i_want.txt (1024)
Packed in/3/1/this_i_want_as_well.txt (1024)
Packed in/3/2/this_i_want.txt (1024)
Packed in/3/2/this_i_want_as_well.txt (1024)
Packed in/3/3/this_i_want.txt (1024)
Packed in/3/3/this_i_want_as_well.txt (1024)
Backup for /tmp/in at revision 1 completed
Note, if you only have +*/
in filters – then nothing gets backed up. I honestly have no idea why this is not added by default by duplicacy:
% cat .duplicacy/filters
+*/
% dpl backup -dry-run
Storage set to /tmp/out
No previous backup found
Indexing /tmp/in
Parsing filter file /tmp/in/.duplicacy/filters
Loaded 1 include/exclude pattern(s)
No files under the repository to be backed up