Rsync exclude-from directory with space

quotingrsync

I am trying to exclude "Mendeley Desktop" directory for rsync.

The exclude-from= is as:

Downloads
*.o
*.iso
Dropbox
Documents/Mendeley\ Desktop

but rsync is still backing up the Mendeley Desktop.

How I can make rsync to ignore the directories with space?

Best Answer

Remove the \ from before the space. An escaped space is used to stop the shell splitting at spaces. As you are using a file to list your excluded directories and files then the words Mendeley Desktop will never pass through the shell and therefore will not need escaping. If you were listing them on the command line with --exclude then you'd need to escape the space.

Use:

Downloads
*.o
*.iso
Dropbox
Documents/Mendeley Desktop
Related Question