2

I have backup server that gathers backups from few other servers. I want to make directory structure like this

/backup/snapshots/<hostname>/<period>.0/<files>

Instead of default

/backup/snapshots/<period>.0/<hostname>/<files>

How to do this? I tried to specify parameter

backup  root@remote-host:/backup/snapshots/hourly.0        .       snapshot_root=/backup/snapshots/myhost/

but it doesn't work

2 Answers 2

0

As far as I can tell, rsnapshots only configuration for this is the "snapshot_root" directive.

Man page: "snapshot_root Local filesystem path to save all snapshots"

These are a few examples from: https://askubuntu.com/questions/20603/what-does-snapshot-root-do

snapshot_root /var/backups/me

...

backup /home/me/movies/ /media/
backup /home/me/music/ /media/
backup /home/me/drafts/ /documents/

After running rsnapshot hourly, for example, the snapshots would be stored under

/var/backups/me/hourly.0/media
/var/backups/me/hourly.0/documents

So, pretty much what I'm saying is that I belive there's no easy way of changing that, and that you might need to change the source for this, but of course I can be wrong and if that's the case, please ignore this answer.

1
  • 1
    Downvoting, because this answer is not helpful, stating an incorrect belief that the question can not be (easily) solved. (It can, see Dmitry's answer, which should be the accepted one.)
    – equaeghe
    May 20, 2016 at 9:30
6

You need to use another configuration file, where you can set different snapshot_root directory (and other backup params).

For example /etc/rsnapshot.additional.conf

After what you need to add to your rsnapshot cron file (if you use Ubuntu - you can find it /etc/cron.d/rsnapshot).

30 3    * * *       root    /usr/bin/rsnapshot daily
10 0  3    * * 1       root    /usr/bin/rsnapshot weekly
11 30 2    1 * *       root    /usr/bin/rsnapshot monthly

lines, like this

30 3    * * *       root    /usr/bin/rsnapshot -c /etc/rsnapshot.additional.conf daily
10 0  3    * * 1       root    /usr/bin/rsnapshot -c /etc/rsnapshot.additional.conf weekly
11 30 2    1 * *       root    /usr/bin/rsnapshot -c /etc/rsnapshot.additional.conf monthly

Which means that rsnapshot will be call two times with different config file and make two backups

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .