OpenVZ Forum


Home » General » Support » Backing up via rsync -- Does it work?
Backing up via rsync -- Does it work? [message #43122] Sun, 24 July 2011 16:50 Go to next message
optize is currently offline  optize
Messages: 33
Registered: September 2006
Member
I run:

/usr/bin/rsync --delete --rsync-path="nice rsync" -vaz /vz /backup

Which backs up /vz to /backup every night. It seems to work as designed, however I'm not confident that's the best way to be backing up a VPS node.

Other options could be:

- R1Soft, which is insanely expensive and works half ass.
- vzdump, which takes full dumps, afaik and would waste a lot of CPU when it's not really needed.

My concerns with rsync is that it has issues with socket files, /dev, etc. I'm concerned that if I ever have to restore my rsync copy, these VPS's wont start up due to missing system files.

Has anyone had any success stories with rsync with both backing up and restoring without issues? I'm all ears.

Re: Backing up via rsync -- Does it work? [message #43123 is a reply to message #43122] Sun, 24 July 2011 17:43 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
I don't use rsync for openvz so I can't help with first hand experience, but the first thing I would do when implementing a backup solution is a restore test. Backups are seldom problematic, restores... well... don't get me started.

Are you seeing any errors when backing the data up? You don't seem to be excluding any files or directories, etc. Create a test container yourself, back it up, delete it, restore it... Tell us all how it went. Smile
Re: Backing up via rsync -- Does it work? [message #43126 is a reply to message #43122] Mon, 25 July 2011 10:58 Go to previous messageGo to next message
TheStig is currently offline  TheStig
Messages: 94
Registered: December 2008
Member
I've copied containers using rsync before, loosly basing my actions on this wiki, http://wiki.openvz.org/Physical_to_container, as the process is quite similar for containers. I've always excluded /dev /proc/ /sys. I recreated dev and sys by copying the files from a precreated image of the same distribution and it worked.

i have to admit, those machines are not what i would call very stable, but it works more or less.

ps: rethinking the whole thing again - u should be able to use /dev and /sys from your backup!

[Updated on: Mon, 25 July 2011 11:00]

Report message to a moderator

Re: Backing up via rsync -- Does it work? [message #43741 is a reply to message #43126] Wed, 12 October 2011 12:35 Go to previous messageGo to next message
yoonique.net is currently offline  yoonique.net
Messages: 3
Registered: August 2011
Junior Member
If you use LVM snapshots it is very easy. You could also use duplicity instead (search also for vzdup in this forum)
Re: Backing up via rsync -- Does it work? [message #44697 is a reply to message #43122] Thu, 22 December 2011 16:45 Go to previous message
votsalo is currently offline  votsalo
Messages: 26
Registered: December 2011
Location: Greece
Junior Member
I believe rsync has no problem with dev files.

I use rsync -a -v to backup my non-openvz OS
I have tried a successful restore (when I regretted an OS upgrade).
I have also cloned my OS to another partition this way. I just had to edit fstab and change the UUIDs to the new filesystems.

However, I do the backup/restore while the OS is not running, because I'm worried about data inconsistencies. I boot to another OS, backup my main OS, and then reboot the main OS. Consequently I don't do these OS backups very often. I do them before I make any major changes (such as upgrading the OS). I backup my working files with rsync daily, without rebooting.

I don't know if the same applies to openvz, since it may have more exotic special files, directory hard links, etc.
Previous Topic: Proxmmox with OpenVZ and veth network configuration
Next Topic: Where do I have to put my contribs?
Goto Forum:
  


Current Time: Mon Jul 15 06:36:51 GMT 2024

Total time taken to generate the page: 0.02371 seconds