LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   problem with rsync exclude (https://www.linuxquestions.org/questions/slackware-14/problem-with-rsync-exclude-4175733935/)

apolinsky 02-16-2024 02:48 PM

problem with rsync exclude
 
I use rsync to backup my thunderbird mail directory every night. I am tring to exclude the cache2 directory using the following command:
rsync -avzrcp --exclude '/home/xxx/.thunderbird/yc4iwpsm.default-default/cache2' /home/xxx/.thunderbird /media/nas2/xxx

In the the test, the cache2 directory (and its contents) were copied. I have obviously made a mistake but so far don't see it.

Thank you.

michaelk 02-16-2024 02:55 PM

The exclude option uses relative paths referenced to the source directory.

lazardo 02-16-2024 05:50 PM

Quote:

rsync -avzrcp --exclude '/home/xxx/.thunderbird/yc4iwpsm.default-default/cache2' /home/xxx/.thunderbird /media/nas2/xxx
Command given is missing the destination.
Code:

rsync -avzrcp --exclude '/home/xxx/.thunderbird/yc4iwpsm.default-default/cache2' /home/xxx/.thunderbird /media/nas2/xxx <destination>

apolinsky 02-16-2024 06:32 PM

The destination is the xxx. The problem was, as explained by Michaelk, the exclude needs the RELATIVE directory (that is relative to overall source.) I only need the --exclude 'cache2' not its complete path.


All times are GMT -5. The time now is 08:00 AM.