a fast, versatile, remote (and local) file-copying tool


-a, –archivearchive mode; equals -rlptgoD (no -H,-A,-X)
-r, –recursiverecurse into directories
-l, –linkscopy symlinks as symlinks
-p, –permspreserve permissions
-t, –timespreserve modification times
-g, –grouppreserve group
-o, –ownerpreserve owner (super-user only)
-x, –one-file-systemdon’t cross filesystem boundaries
-Dsame as –devices –specials
–devicespreserve device files (super-user only)
–specialspreserve special files
–no-OPTIONturn off an implied OPTION (e.g. –no-D)
-n, –dry-runperform a trial run with no changes made
–deletedelete extraneous files from dest dirs
–info=FLAGSfine-grained informational verbosity

info flags

DELMention deletions on the receiving side
PROGRESSMention 1) per-file progress or 2) total transfer progress
info FLAGS
rsync --info=help
rsync --info=progress2


rsync: failed to set permissions on “somedata”: Operation not permitted (1)

rsync -av --no-perms ...

Synchronize folders over SSH

Copy over SSH

rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /mnt/video/foo.avi admin@server:/tank/
rsync -avzhe ssh /wineprefixes/path/hearthstone leopardb@laptop:/home/user/Wine/

Synchronize (delete on receiver)

First line is with –dry-run to see what would happen, the –delete switch is dangerous.

rsync -avz --update -e ssh --progress --delete user@remote:/home/user/Documents/ /home/user/Documents/ --dry-run
rsync -avz --update -e ssh --progress --delete user@remote:/home/user/Documents/ /home/user/Documents/


To exclude the folder /stornext/projects/test from the job:

rsync -avh --exclude=/test /stornext/projects/ /stornext/backup/projects/DATE/


Exclude from file:

leo@computer:~$ more excludes.txt

rsyncd daemon



rsync -n comp_or_IP::
rsync -av --password-file=/root/rsyncpasswd a_file rsync://user@

Synology bug

you have to provide --rsync-path otherwise some random permission denied happens:

rsync --rsync-path=/usr/bin/rsync -avzhe ssh user@synology-nas.lan:/volume1/SHAREDFOLDER/whatever .

Time stuff and send email upon completion


/usr/bin/time -h rsync -ah --one-file-system --info=progress2 --no-perms /mnt/storage/dataset1/stuff /mnt/storage/dataset2/ ; echo "" | mail -s "rsync finished" root


/usr/bin/time -f "time used:\t%E" \
rsync -ah --info=progress2 --delete \
/mnt/mirror03/Backup /mnt/mirror02/ ; \
echo -e "Subject:Finished\n\nDone.\n" | sendmail root

Rsync with Android

rsync --verbose --progress --omit-dir-times --no-perms --recursive --inplace ~/Videos/ ./

Interesting scripts: