Rsync for Mad Fly Hackers. Straight to the point.

The rsync man page with some jQuery chained one-liner magic.

Author: Pat Skinner

Usage:

rsync -a sourceDir destDir
rsync -a sourceDir host:destDir


rsync -ai sourceDir host:destDir

-a means 'archive'

Changed Functionality:

Current cron job:
Every 4 hours, at 10 minutes past the hour, backup - add

10 7-23/4 * * * /root/backup.sh >> /backup/logs/backup_log.txt 2>>/backup/logs/backup_log.txt

Proposed cron job:
New logfile for every backup.

$date = `date +%Y-%m-%d-%T`
# example date is 2008-01-18-13:00:15
# ordering by descending unit of time (year month day) allows listing logs by time order
10 7-23/4 * * * /root/backup.sh > /backup/logs/backup_log_$date.txt 2>/backup/logs/backup_log_$date.txt
# we use > to create a new file (not >> to append)
# Additionally, backup.sh should add the -i parameter to rsync to capture the benefits of detailed changelogs

-i means '--itemize-changes'

-d means '-delete'



RSync Flags Reference