Simply put, rsync
uses relative paths to determine what to exclude. From the rsync
manpage:
If the pattern starts with a / then it is anchored to a particular spot in the hierarchy of files, otherwise it is matched against the end of the pathname. This is similar to a leading ^ in regular expressions. Thus "/foo" would match a file named "foo" at either the "root of the transfer" (for a global rule) (…)
The simplest way to work around this is to use --relative
/ -R
, which lets you exclude Dropbox like so:
rsync -avR --exclude='/Users/alex/Dropbox' /Users/alex /Volumes/Backup_Mac
The name relative
refers to how rsync
sends the paths and therefore doesn't have anything to do with specifying absolute exclude patterns.
Note that this creates the full directory tree /Volumes/Backup_Mac/Users/alex/
, but that's not a terribly bad thing in your case.