Home » Misc Tech Stuff

Setting up rsnapshot using a custom location for the config file

20 October 2008 1,589 views 3 Comments

I decided that I needed to start backing up my websites as well as my home computers, and I wanted to do this at a third party location, that way if my local backups failed, I would still have another option. After doing some research I decided to use Rsync Palace. The three default packages that they offered didn’t suit my needs so I spoke with the owner Otto Yiu and was able to setup a custom package for me. In no time I had my account setup.

I decided to use rsnapshot because of its ability to automatically do all of the things that I need while not utilizing too much hard disk space, which of course saves me money. rsnapshot uses hard links which means that it only has one copy of the file, and then just links to it between the different backups which is where the disk space savings happens. It also creates multiple backups. You can do hourly, daily, weekly, monthly, and then even customize your own. rsnapshot will automatically rotate the backups, so that your newest is always in the .0 folder.

Then I ran into a problem. Mr. Yiu informed me that they do have rsnapshot installed, however users do not have access to modify anything in the /etc directory, which poses a problem since the configuration file for rsnapshot is located in /etc.

Luckily rsnapshot has the ability to define a custom location for your config file, and it is extremely easy to do. I’m not going to go over editing the config file for rsnapshot as that is well documented both in the actual config file as well as on the rsnapshot website. I am going to specifically go over how to setup your crontab to use the config file that is in your custom location.

The default crontab entry is:

0 */4 * * * /usr/local/bin/rsnapshot hourly
30 23 * * * /usr/local/bin/rsnapshot daily

The above entry will pull your rsnapshot.conf from /etc/rsnapshot.conf which would work fine in normal situations, however in my situation, I am not able to modify anything in the /etc directory, so I had to modify my crontab entry to look like this:

0 */4 * * * /usr/local/bin/rsnapshot -c ~/rsnapshot/rsnapshot.conf hourly
30 23 * * * /usr/local/bin/rsnapshot -c ~/rsnapshot/rsnapshot.conf daily

The actual location of rsnapshot may vary between different setups. The default on the rsnapshot website is /usr/local/bin/rsnapshot however if you are using Rsync Palace and probably some other services it is actually located at /usr/bin/rsnapshot, therefore your crontab entry would look something like:

0 */4 * * * /usr/bin/rsnapshot -c ~/rsnapshot/rsnapshot.conf hourly
30 23 * * * /usr/bin/rsnapshot -c ~/rsnapshot/rsnapshot.conf daily

This should easily get you up and running with your backups using rsnapshot. Good luck!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)


  • J said:

    Just what I was looking for thanks!

  • haydent said:

    thanks for this ill try it out. as i only just got rsnapshot command enabled on my account after it not being there for some reason…

  • haydent said:

    after not being able to see the conf file tech advised me to download it from here: http://www.las.ic.unicamp.br/paulo/ferramentas/rsnapshot.conf

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.