Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently running rsnapshot on host1, backing up some files from host2 using the inbuilt SFTP support (I have daily, weekly, and monthly backups running in a standard rsnapshot configuration). Both hosts are running Ubuntu and use LVM. Is there any straightforward way I can create and mount LVM snapshots on host2 to back up from, before a backup run is started, and delete them afterward, to increase the consistency of the set of files that are backed up? It looks like more recent versions of rsnapshot have LVM support built in using the linux_lvm_* commands, but that only seems to work when backing up from the same host, which I'm not doing. Ideally the mechanism ought to be fairly failure redundant, i.e.:

  • The LVM snapshots on host2 should be deleted after the backup is completed, whether it was successful or not.
  • If a snapshot cannot be created, the backup doesn't proceed.
share|improve this question

1 Answer 1

Maybe you are asking too much from a single rsnapshot instance. Why don't you use a script on host2 to create the snapshot, including the creation of a report and a flag, and then let rsnapshot from host1 do it's part depending on the presence of the flag ?

I usually create the backup locally then let the backup server grab it through an NFS mount, but it depends on the available space on host2 of course.

share|improve this answer
    
I'm not convinced that's any easier. How would host2 know when it could safely unmount/delete the LVM snapshot? (bearing in mind that rsnapshot doesn't necessarily take the same amount of time to execute each time, depending on which much data has changed) –  Andrew Ferrier Jan 25 '13 at 12:40
    
That's not easier. But I don't think it's possible to do it the way you want, except maybe by inverting the direction of the rsnapshot (pushing the backup from host2 to host1 with an rsnapshot running on host2). This way you could use the LVM options of rsnapshot. –  Rosco Jan 25 '13 at 14:46

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.