rsync is a cool beast with a billion options it allows you to ssh-secured transfer your backups to remote locations…

pros:

  • does chunk-wise md5 integrity check on files if files  differ only slightly it will „delta-transfer“ only the diff not retransfer the whole file…

cons:

  • complicated: the amount of options and combinations of options can be overwhelming.

you can even specify the bandwidth to be used:


# over INTERNET
rsync -vv --bwlimit=65 -r --archive --partial --inplace --progress --compress -e 'ssh -p22' /BACKUP/DAILY/ USER@SERVER:/BACKUP/DAILY/

on LAN lave out the

--compress

option because it’s CPU intense

while

--bwlimit=65

limits the amount of upload-bandwidth used (just in case you need internet at the same time)

example:

rsync -vv --bwlimit=65 -r --archive --partial --inplace --progress --compress -e 'ssh -p22' /BACKUP/DAILY/ USER@SERVER:/BACKUP/DAILY/

example script called: onlineBackup.sh

that could be called by cron every hour:

#!/bin/bash
ps cax | grep -v rsyncd | grep -v grep | grep rsync > /dev/null
if [ $? -eq 0 ]; then
  echo "Process is running."
else
  echo "Process is not running."

# backup more important first
rsync -vv --bwlimit=65 -r --archive --partial --inplace --progress --compress -e 'ssh -p22' /BACKUP/DAILY/ USER@SERVER:/BACKUP/DAILY/

fi
[/share/MD0

admin