If you answered yes to any of those questions, then rsnapshot is the tool for you. With rsnapshot, this is what your backup plan will look like:
What this means to you is speedy and redundant recovery:
To check whether you have rsnapshot installed on your *nix machine, open up a terminal and enter the following command
rsnapshot:, then you need to get it installed.
Installing rsnapshot may be as simple as using your package management system. Depending on your flavor of *nix, enter one of the following into a terminal:
sudo apt-get install rsnapshot
sudo yum install rsnapshot
sudo zypper install rsnapshot
Once you are assured that rsnapshot is installed, you'll want to edit rsnapshot.conf. It's kept in the /etc, so you'll need to be in super-user (sudo) mode to edit it. The following is a list of edits that you'll need to make.
This is the local path to where rsnapshot will place it's snapshots. You'll need to use a trailing slash ( "/" ) for all directory paths.
If you wondered about this, you are in good company: so did we.
This is just how rsnapshot works:
However, this isn't necessarily a bad thing. Consider the following:
We suggest: /backup/snapshots/
Backup Intervals controls two things:
# interval hourly 6
interval daily 7
interval weekly 4
interval monthly 3
Backup points are how you direct rsnapshot what you want to to take snapshots of. You can have as many snapshot directives as you like. Each directive has three tab separated fields:
[instruction] [path to backup target]/ [snapshot_root subdirectory name]/
For example, you might want to backup:
backup /var/www/ localhost/
backup /etc/ localhost/
backup_script /backup/ecommerce-mysqldump.sh localhost/ecommerce-mysqldb/
backup firstname.lastname@example.org:/path/ my-ssh-enabled-server/path/
Note: remember the trailing slash for directories!
Once you are ready to test your rsnapshot configuration, enter the following into a terminal:
Of course, if you hit a snag, don't get frustrated. Contact us — we're here to help: email@example.com .
Note: If you would like a more detailed guide to setting up an rsync script, then check out:
Essentially, the rsync script that you create needs only to back up the contents of snapshot_root. Here are the steps / commands to creating the rsync script to back up your snapshots to your EVBackup account:Notes:
sudo), so that you have full access to all the files on your machine.
sudo ssh-keygen -f /backup/ssh_key -t rsa -N ''
An SSH key pair allows you to securely login to your backup server without entering a password each time.
sudo rsync -e ssh /backup/ssh_key.pub firstname.lastname@example.org:ssh_keys/key1.pub
ssh email@example.com addkeys
userwith your EVBackup account name.
sudo ssh -i /backup/ssh_key firstname.lastname@example.org
If you were successful, then something very similar to the following will appear in Terminal:
Last login: Thu Jul 15 16:16:44 2010 from c-28-26-13-101.
Copyright (c) 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.4-STABLE (EXAVAULT) #1:
sudo rsync -avz --hard-links --dry-run -e "ssh -i /backup/ssh_key" /backup/snapshots email@example.com:remote-folder
Because the rsync argument -a implies a --recursive argument. Effectively, that means that if the target of the rsync script is a directory, then it and all sub-directories will be backed up.
Note that rsnapshot still requires a trailing slash on directories.
sudo echo "rsync -avz -e \"ssh -i /backup/ssh_key\" /backup/snapshots firstname.lastname@example.org:remote-folder" > /backup/backup-snapshots.sh
sudo chmod +x /backup/backup-snapshots.sh
Remember: if you need help, just ask: email@example.com
When you are ready to go, run the daily backup. Enter the following into a terminal:
sudo rsnapshot daily
The expected sequence of events that you will need to validate are:
Here are two easy ways to check:
ssh firstname.lastname@example.org ls -Ar remote-folder
Once you have your backup script created and saved, you need only to add a cron job to automate it. To automate a cron job for your rsync script:
sudo crontab -e
For example, to run rsnapshot daily Monday through Saturday at 11:42 PM, you would enter:
42 23 * * 1-6 rsnapshot daily
The fields in crontab (separated by s p a c e s or tabs) are:
[minute] [hour] [day of month] [month] [weekday] [command] [command args]
For example, to run rsnapshot weekly on Sunday at 1:42 PM, you would enter:
42 13 * * 0 rsnapshot weekly
For example, to run rsnapshot monthly on the 3rd of each month at 4:42 AM, you would enter:
42 04 03 * * rsnapshot monthly
Should you have questions or need help: email@example.com