Reading Time: 1 minute, 19 secs

Setup rSnapshot backups on CentOS

In this article I will be talking you through how to use rSnapshot and rSync to backup your server with an email alert when the backup has been completed and what has been backed up.

1. You must first have rSync and rSnapshot installed:

2. Once installed you will then need to create the correct configuration files for your server. Here is an example of what I use (save as backup_config.conf):

NOTE: It is important to use tabs between each argument otherwise you will receive errors.

3. Now we need to create an exclude file, this will exclude any directories that you don’t want to backup. This needs to be placed in the location specified on you conf file above(save as backup_config.exclude):

NOTE: when adding a sub directory e.g. + /var/www you must first include + /var and then your sub directory, you can then exclude the existing directories as I have in my example. (you dont need to use tab in this file)

4. Create the directory for backups and logs to be stored:

5. Test the backup by running:

If successful move on if not troubleshoot, ask below if you get stuck.

6. Schedule the backup with crontab:

If you would like email alerts use the following:

NOTE: If the backup fails the email will be empty, I still haven’t figured out how to resolve this to email the errors, If you know please let me know in the comments!


Leave a Comment.