Originally Posted by szboardstretcher
You'll need an --exclude= for each path. If I wanted to sync /var/ to /backups/ and exclude /var/log and /var/lib I would:
rsync -varhz --progress --delete --exclude 'log' --exclude 'lib' /var/ /backups/
The excludes are relative to the directory you are backing up... if you are backing up /var/ just imagine that an exclude statement invisibly already says --exclude '/var/' so all you have to add is the 'log'
Good Followup @szboardstretcher,
When I ran the incorrect command and saw way too many files being copied, I took the time to research the use of the rsync. I modified the script in the manner you suggest and it worked correctly, only updating the few files that had been modified on the source server.
I didn't think of it earlier, but it would be helpful if I posted the correct version of the script in case someone comes across this thread when looking for help. Here's the correct version to exclude the two image folders as I had originally intended:
rsync -raEz --progress -e ssh --delete --exclude=.svn --exclude 'html/group1/images/products' --exclude 'html/group1/images/company' /var/www/application host:/var/www/