Thursday, November 10, 2011

Solaris: Using rsync to mirror or transfer data between servers

A basic example being to mirror every hour on the hour:
0 * * * * rsync -e ssh -avz user@liveserver:/home/httpd /home 2>&1 > /var/log/hourly_backup.log
Then remove deleted files every night:
30 0 * * * rsync -e ssh --delete-after -avz user@liveserver:/home/httpd /home 2>&1 > /var/log/nightly_backup.log