backup | rsync

rsync

local rsync

rsync -Pahh --delete-delay --stats /dir1/ /dir2

rsync over ssh (z is for compression)

rsync -Pahhz --stats --info=progress2 -e "ssh -p40" /source/ user@238.237.21.20:/destination

rsync -Pahh --delete-delay --bwlimit=20 -e "ssh -p40" /mnt/tarski/film/ user@238.237.21.20:/home/USER/files/film

no permitions

rsync -Pahh --perms --no-perms --no-owner --no-group --omit-dir-times --stats --delete-delay /source/ /destination

change ownership

rsync -Pahh -og --chown=username:groupname --stats --delete-delay /source/ /destination

Use of –include and –exclude options

rsync -Pavze ssh --include 'R*' --exclude '*' root@192.168.0.101:/source/ /destination

rsync -Pahhz --exclude=/gizli --stats --info=progress2 --delete-delay -e "ssh -p40" /source/ 100.22.90.15:/destination

Reference

archlinux