Excluding absolute paths in rsync

rsync

The man page for rsync suggests that I should be able to write

-/ /home/me/foo

in exclude.foo and then run

rsync -a --exclude-from exclude.foo /any/path/ /dest/

and have /home/me/foo excluded, but I cannot seem to get it to work (the path is copied).

Does that syntax exclude absolute paths?

Best Answer

The exclude should look like this

- foo

& the rsync CMD should look like this

rsync -a --exclude-from=exclude.filter /home /dest

Hope this was helpful.