rsnapshot

rsnapshot

apt-get install -y rsnapshot

mv /etc/rsnapshot.conf /etc/rsnapshot.conf.org

cat < /etc/rsnapshot.conf
config_version 1.2
snapshot_root /media/backup/
logfile /var/log/rsnapshot.log
verbose 3
loglevel 3

cmd_preexec /bin/mount /media/backup
cmd_postexec /bin/umount /media/backup
#backup_script /usr/local/bin/backup_mysql.sh localhost/mysql/

cmd_rsync /usr/bin/rsync
cmd_ssh /usr/bin/ssh
ssh_args -F /home/foo/.ssh/config -i /home/foo/.ssh/id_rsa

interval daily 7
interval weekly 3
interval monthly 1

#exclude dev/*
exclude lost+found/*