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 --append-verify --inplace --progress --compress -e 'ssh -p22' /BACKUP/DAILY/ USER@SERVER:/BACKUP/DAILY/

src: https://unix.stackexchange.com/questions/48298/can-rsync-resume-after-being-interrupted

--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 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 --append-verify --inplace --progress --compress -e 'ssh -p22' /BACKUP/DAILY/ USER@SERVER:/BACKUP/DAILY/
fi


admin