2008年11月20日 星期四

Rsync and bandwidth shaping

SSH is a UNIX app that follows the idea of small simple tools that can be used together for a greater good. One of the lesser known features is that the old rsync command/protocol can be run over SSH. This provides authentication and encryption, plus some other goodies. What you can also do is force maximum compression, a different crypto cipher such as Blowfish instead of the default of 3DES, and bandwidth limiting.

BWLIMIT=23 # in kbyte/s
RSYNC_RSH="ssh -C -c blowfish -p 22"
alias rsync="rsync -avz --bwlimit=$BWLIMIT"

rsync wim@remote:/path/to/something/big ~/downloads