It appears in the code below, rsync
ignores --exclude
. How would I correct that, and extend it to multiple directories?
$ rsync --help | grep Usage
Usage: rsync [OPTION]... SRC [SRC]... DEST
$ man rsync | grep -- '--exclude'
--exclude=PATTERN exclude files matching PATTERN
$ sudo rsync -avz --exclude='/home/erwann/.cache/' '/home/erwann' '/run/media/erwann/bkup'
sending incremental file list
erwann/.cache/mozilla/firefox/otj9do4j.default-release/cache2/
erwann/.cache/mozilla/firefox/otj9do4j.default-release/cache2/index
erwann/.cache/mozilla/firefox/otj9do4j.default-release/cache2/doomed/
erwann/.cache/mozilla/firefox/otj9do4j.default-release/cache2/entries/
sudo rsync -avz --exclude='erwann/.cache/' '/home/erwann' '/run/media/erwann/bkup'
to extend it to multiple dirs, either work with pattern-matchin in the exclude or take a look at --exclude-from/home/erwann/.cache/erwann/.cache
, if that directory existed./home/erwann/whatever/erwann/.cache
?erwann/.cache
directory beneath the source path.