I am trying to backup my home folder to an external drive with the following command:
rsync -acu --delete --exclude-from='/home/chh1/rsync_exclude.txt' /home/ /media/chh1/f86f92f7-bcb4-4b8e-8a64-8a210606d422/home_backup/
The --exclude-from= file
contains the following entries:
I really want to exlude .cache but also .dconf which is contained within it as I want to exclude files that require root privileges and unnecessary .cache data contained in /home/chh1/.cache.
When I run
find ~ -name ".cache"
I get the following output:
/home/chh1/snap/pdfmixtool/common/.cache /home/chh1/snap/gnome-system-monitor/common/.cache /home/chh1/snap/okular/63/.cache /home/chh1/snap/freemind/common/.cache /home/chh1/.cache find: ‘/home/chh1/.cache/dconf’: Permission denied
I really want to exclude
which would take care of dconf and general .cache junk as well. However, I do not want to exclude the other .cache directories found when running the find command.
since --exclude-from= only matches patterns with what is in the exclude file, how can I specify a path rather than a pattern and preferably within the exclude file? Is there a way?
Thanks for your help it is indeed much appreciated!