Run the following:
brew install rsnapshot
sudo perl -MCPAN -e'install Lchown'
Put the following in /usr/local/etc/rsnapshot.conf
:
# This file requires tabs between elements
cmd_rsync /usr/local/bin/rsync # brew install rsync
config_version 1.2
snapshot_root /.snapshots/
retain hourly 8
retain daily 7
retain weekly 4
verbose 1
loglevel 3
lockfile /var/run/rsnapshot.pid
backup /home/ localhost/
backup /etc/ localhost/
backup /usr/local/ localhost/
Put the following in root's crontab:
# minute | hour | day of month | month | day of week
3 * * * * /usr/local/bin/rsnapshot -v hourly
2 1 * * * /usr/local/bin/rsnapshot -v daily
1 1 * * 1 /usr/local/bin/rsnapshot -v weekly