duplicity and --rsync-options: exclude file is ignored

26 Views Asked by At

OS: Debian Buster duplicity: 0.7.18.2 rsync: 3.1.3 protocol version 31

I am backing up /directory and I want to exclude /directory/.cache. My exclude file just contains ".cache" (without quotes of course) on one line. When I am using my exclude file just with rsync, ".cache" is omitted as expected. When I'm using it with duplicity, it isn't. Here's my command:

duplicity -v9 --rsync-options "--exclude-from=/path/to/exclude-file.txt" full /directory rsync://remotehost://some/dir/

I have tried the rsync-options with additional single quotes (like --rsync-options "--exclude-from='/path/to/exclude-file.txt'") and also moved it to the end of the command, to no avail. /directory/.cache is always in the backup. The rsync-options statement is entirely ignored. What am I missing?

Tried variations of the above command, with and without single and double quotes.

1

There are 1 best solutions below

0
ede-duply.net On

unrelated but important. your duplicity version is very old (2018-10) and not maintained anymore. consider upgrading using one of the distribution channels (pip, snap ...)

looks like a user error. in/excluding files for backup should be done with duplicity selection arguments. e.g.

duplicity --exclude "/directory/.cache" ...

rsync is merely the backend that the resulting backup archive files are transferred with to a backend. no need to exclude anything with rsync.

the old duplicity 0.7 man page is still online. more details there https://duplicity.nongnu.org/vers7/duplicity.1.html#sect9