Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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 me@example.com:/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.

share|improve this answer
    
@j-g-faustus So I can for example specify snapshot_root user@myserver.com/ and then backup /var/www/localfolder/ /remoteFolder/ ? Are the trailing slashes correctly added ? –  Patrick Jan 8 '11 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/… –  j-g-faustus Jan 8 '11 at 14:29
    
@j-g-faustus Sorry, I've just tried now and I get this ERROR: snapshot_root user@myserver.com/ - snapshot_root \ must be a full path –  Patrick Jan 8 '11 at 15:04
    
Probably because I can only mount the server first ? So should I run something like mnt servername.com ? –  Patrick Jan 8 '11 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. –  j-g-faustus Jan 8 '11 at 16:06

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 user@192.168.0.2:/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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.