Rsync examples

Category: Note to Self

To rsync between 2 hosts you should have a public key to allow password-free login

Example 1: Copy all files to remote folder

rsync -avz -e ssh /source/path/

Example 2:  rsync operation deleting files on the remote side that do not exist on local:

rsync -azv --delete -e ssh /source/path/

Example 3:  exclude specified files from operation

rsync -azv --delete -e --exclude 'Thumbs.db' --exclude '.DS_Store' /source/path/ /destination/folder/