revlis.nl
Stash of notes about OSS, OSes, devops, virtualization, programming (hobby) projects &c
January 20, 2014 — 0:40
Author: silver Category: linux Comments: Off
Copying files locally and between hosts using ssh
Used options:
a
archive (-rlptgoD
)
A
preserve ACLs
c
checksum
n
dry-run
r
recursive
v
verbose
Examples:
rsync -arv --delete /mnt1/backups/ /mnt2/backups/
l
recreate symlinks
t
preserve modification times
rsync -v -rlt --delete /mnt1/backups/ /mnt2/backups/rsync -avte 'ssh -p 2299' /dir1/dir2/ [email protected]:/dir1/dir2/
for i in dir1 dir2 dir2; do rsync -avte 'ssh -i /root/rsync_id_rsa -p 2222' /source/$i/ [email protected]:/target/$i/ done