It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
apt-get update
apt-get install rsnapshot -y
nano /etc/rsnapshot.conf
apt-get install nano
snapshot_root /backup/
cmd_ssh /usr/bin/ssh
cmd_du /usr/bin/du
Next, we need to consider how many old backups we would like to keep. In following example, after 6 "hourly" snapshots the oldest "hourly" is deleted. The top entry (in this case "hourly") is copied from the source, while the remaining entries simply link to the latest snapshot from one level above.retain alpha 6
retain beta 7
retain gamma 4
Finally, you’ll need to decide on what you would like to backup. If you are backing up locally to the same machine, this is as easy as specifying the directories that you want to save and following it with “localhost/” which will be a sub-directory in the snapshot_root that you set up earlier.backup /home/ localhost/
backup [email protected]:/home/ example.com/
rsnapshot configtest
rsnapshot -t alpha
echo 9148 > /var/run/rsnapshot.pid
mkdir -m 0700 -p /backups/
mkdir -m 0755 -p /backups/alpha.0/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
/home/ /backups/alpha.0/localhost/
mkdir -m 0755 -p /backups/alpha.0/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded /etc/ \
/backups/alpha.0/localhost/
mkdir -m 0755 -p /backups/alpha.0/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
/usr/local/ /backups/alpha.0/localhost/
touch /backups/alpha.0/
If everything seems right you can try to setup backup for the first time, just remove "-t" from the previews command:rsnapshot alpha
nano /etc/cron.d/rsnapshot
# This is a sample cron file for rsnapshot.
# The values used correspond to the examples in /etc/rsnapshot.conf.
# There you can also set the backup points and many other things.
#
# To activate this cron file you have to uncomment the lines below.
# Feel free to adapt it to your needs.
0 */4 * * * root /usr/bin/rsnapshot alpha
30 3 * * * root /usr/bin/rsnapshot beta
0 3 * * 1 root /usr/bin/rsnapshot gamma
#30 2 1 * * root /usr/bin/rsnapshot delta
These settings will run add a snapshot to the “alpha” directory within our “/backup/” directory every four hours, add beta (daily) snapshot everyday at 3:30, add a gamma (weekly) snapshot every Monday at 3:00.