Rsync¶
Commonly used switches for rsync¶
with status and Common variable
rsync --verbose --progress --stats --compress --recursive --times --perms --links <source> <destination> (location is defined as [hostname]::path)
SSH Wrapper¶
SSH Wrapper allows to transfer files using rsync over SSH.
Mostly usefull when dont have Rsyncd not running and have only access over ssh.
Limit Bandwidth / Disk I/O¶
To limit bandwidth when transferring over Network.
OR
Limit Disk I/O when transferring between Disk.
Use "--bwlimit" switch. it is measured as "KBytes"
Following example limit 100 MB/s
General rsync Commands¶
Authenticated Rsync¶
define rsync mount point in rsyncd.conf
File: rsyncd.conf
[root]
path = /srv/www/htdocs
secrets file = /etc/rsyncd/rsync.secret
auth users = htdocs
read only = false
write only = true
list = false
File: rsync.secret
NOTE : - Password is clear text password. - Make sure password file is not world readable else it will fail to authenticate.
Define script for rsync OR run it from command line.
File: rsync_test.sh
#!/bin/sh
export RSYNC_PASSWORD=password123
/usr/local/bin/rsync -az --delete --exclude='.*' /srv/www/htdocs/ rsync://[email protected]/root/