6

I want to use rsnapshot for remote backups of my websites.

It is not clear this line in rsnapshot.conf:

snapshot_root   /.snapshots/

In the documentation, it says snapshots are stored in this directory, but I actually want them to be stored on a remote server and this is specified later with the line

backup local_folder remote_server

so what's snapshot_root then ?

2 Answers 2

6

snapshot_root is the root for the paths you specify under backup.

For example:

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

The snapshot target must be a local filesystem (although the source can be remote).

I think the simplest option is to put the rsnapshot service on the remote server, and let it copy from your webserver. Using ssh, it would look something like

snapshot_root  /var/backups/me/
...
backup [email protected]:/home/me/movies/ /media/

You would need to have the ssh daemon running on the "example.com" box, and configured so that the user (here "me") can ssh into "example.com" without being asked for a password.

See the rsnapshot HOWTO (section 4.3.8 Backup) for more details.

11
  • @j-g-faustus So I can for example specify snapshot_root [email protected]/ and then backup /var/www/localfolder/ /remoteFolder/ ? Are the trailing slashes correctly added ?
    – aneuryzm
    Jan 8, 2011 at 14:21
  • 1
    Yes, that should work. The trailing slashes are correct, rsnapshot is a bit picky on that :) See also the howto: rsnapshot.org/howto/1.2/… Jan 8, 2011 at 14:29
  • @j-g-faustus Sorry, I've just tried now and I get this ERROR: snapshot_root [email protected]/ - snapshot_root \ must be a full path
    – aneuryzm
    Jan 8, 2011 at 15:04
  • Probably because I can only mount the server first ? So should I run something like mnt servername.com ?
    – aneuryzm
    Jan 8, 2011 at 15:06
  • Ah, sorry. The snapshot target, the place you are writing to, must be a local filesystem - only the source can be remote. Mounting might work if under some circumstances, but not in the general case, I think. Jan 8, 2011 at 16:06
1

I had the same issue... and discovered that if I locally mount a folder from the remote system, then rsnapshot will allow me to set the "snapshot_root" configuration parameter to point to it.

This then allows me to store my snapshots and my backup on the same remote server.

eg.

Mount a folder from the remote system

mount 192.168.0.2:/volume1/Backup /mnt/Backup

Set the "snapshot_root" configuration parameter to point the mounted folder

snapshot_root /mnt/Backup/rsnapshot/

Set a rsnapshot backup point to backup a local folder remotely

backup /home/backup-source [email protected]:/volume1/Backup/backup-target/ rsync_short_args=-trvsz

Note: Although I could have simply designated the mounted remote folder instead as a backup destination, (see below), this would not have enabled me to utilise the Rsync server running on the remote target, (in this case a Synology NAS). I used shared keys to allow rsnapshot to access the remote backup target without a password

backup /home/backup-source /mnt/Backup/backup-target/ rsync_short_args=-trvsz

You must log in to answer this question.

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