1

I'm using rsync with --delete-excluded flag but I still see contents in the destination folder. I'm trying to exclude and delete excluded cache from all chromium like browsers. Here's what I'm doing

rsync -av --delete --exclude-from='exclude.txt' --delete-excluded /home/user /media/user/extDrive/backup/
the exclude.txt:
**/Default/Cache/**

I've also tried:

**/Default/Cache/

But I'm still seeing contents inside Default/Cache at the destination. It seems to be excluded correctly, but it's not deleting the contents from the destination.

Any ideas?

4
  • 1
    rsync can be finicky with the top level directory of the source and destination. Please edit your question with the exact source and destination syntax you are using. For example I had to change this rsync --delete-excluded --archive --verbose --exclude-from=exclude_files /mnt/c/Users/dsmyt/* [email protected]:/media/sdb/backup/s18-windows to this rsync --dry-run --delete-excluded --archive --verbose --exclude-from=exclude_files /mnt/c/Users/dsmyt [email protected]:/media/sdb/backup/s18-windows to get it to work properly. Feb 21, 2023 at 15:59
  • ok, i edited to match. should i have used the --delete-excluded flag before my orgin position? wonder if that has anything to do with it. Feb 21, 2023 at 16:14
  • Try changing the contents of exclude.txt from this **/Default/Cache/** to this Default/Cache. Feb 22, 2023 at 1:54
  • wouldnt that just exclude 1 folder, namely /home/user/Default/Cache. from destination. the exclude while syncing seems to work correcly in globbing all folders with the path pattern containing 'Default/Cache' in all my folers as i have my browser profiles in a lot of different folders. i just dont know why its not dissappearing on the destination's end. Feb 22, 2023 at 3:44

0

You must log in to answer this question.

Browse other questions tagged .