I\'m trying to backup a filesystem, exclude /mnt
but include a particular path within /mnt
, it looks like using --filter is recommended over --include
For me, this command is doing the job:
rsync -aA -H --numeric-ids -v --progress --delete \
--filter="+ /mnt/data/i-want-to-rsyncthisdirectory/" \
--filter="- *" . /mnt/data/mybackup/
Basically, I used a + filter for the directory in question and exlcude all the others (as you do in your given example).
There is no need to explicitly negate all the directories you do not want to sync. Instead, you can ignore all except the one in question.