MacOS – Rsync exclude-from not working

backupbashmacosrsync

I have created a rsync script which has been working fine until I made recent modifications adding exclude-from clause to it.

When running the script it returns the following error:

rsync error: error in file IO (code 11) at
/SourceCache/rsync/rsync-42/rsync/exclude.c(1005) [client=2.6.9]

The bash script is as follows:

echo "Starting sync..."
rsync -vrtL --delete --exclude-from 'sync-music.exclude.txt' ~/Music/ 'remote:/Music/'

The sync-music.exclude.txt file consists of this…

*.ipa
.DS_store
Cache/*

EDIT:
I have noticed that it works when I am in the CD'd into the folder where the bash and exclude files reside. It must be something to do with the the paths.
I have tried adding the path in front of sync-music.exclude.txt but that has not fixed the issue.

Best Answer

I encountered a similar problem.

If you use full paths it should work (note using ~ does not appear to work).

I found comment in a Ubuntu book "scp assumes that all paths are relative to the home directory of the user unless a full path is given". The same seems to apply to rsync