6

I have some servers and VPSs to many companies across the world. I want to back them up locally. I have some backup solutions enabled to remote hosts, but I want to have a local backup on a computer at home.

What I am thinking is:

  1. Create a virtualbox virtual machine, install the same version linux as the server.

  2. Use rsync to backup the server to the local virtualbox machine. (something like rsync -av --delete --progress --exclude '/dev/' --exclude '/proc/' root@server_ip:// / )

  3. Repeat the command every few days update files.

  4. In case of a hard disk failure, or any other bad event, reverse the rsync command and get the files back and continue my bussiness.

I tried it with 2 openvz VPS, the one was a backup of the other. I also tried to transfer normal linux server host to openvz machine and it worked great.

That way looks pretty clean and easy to me, this is the kind of solution I am looking for. However I need to be sure that this will work if I am going to do it.

The question is, will that work ok ? Does anyone see any problem with that ? Do you have any other suggestions ?

Thanks

0

4 Answers 4

2

You should add some methods to easily reconstruct the disk structure (partition table, file systems, mount points).

Also, an rsync backup can horribly fail in some cases where file are kept open for a long time and are steadily updated. Database servers are prime examples for this - you can't reliably backup a running database with rsync.

1
  • Let's say I don't have anything special with partitions, and I stop mysql, or I run mysqldump to backup mysql files. Will that work ok ? You don't see any other problem with that ?
    – user146526
    Nov 21, 2012 at 22:23
1

Keep in mind that rsync can take an awful lot of time and the status if the files may be inconsistent as you will copy the files in different points in time. Probably a good idea would be to create a snapshot in the server (using LVM as mentioned in http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html ) and then rsync from the snapshot to the virtual machine.

0

If you're going to be regularly backing up a bunch of machines, I suggest that you instead use Bacula. It's much more suited to the task, handles stopping at partition boundaries by default, allows various storage servers, scheduling, etc. It also allows you to ignore files you know won't back up correctly (such as your a huge live database), and create files via scripts (say, the dump script for your huge database).

I'm not sure exactly what reason you're cloning to virtual machines unless you plan to run those images as stop-gap replacements. Regardless, with a proper virtualization setup you should also be able to launch these machine images in most cases, and in any case you can write restores to a filesystem directory of your choosing.

0
0

You may want to look at something like BackupPC which uses the rsync protocol to identify and copy changes that need to be copied. The first backup of each system will require a full copy of all files being backed up. After that only deltas need to be copied. It will copy an addition 1% of the structure to do verification changes.

It is very efficient storing files which are duplicated across systems or directories. This can greatly reduce disk space requirements for your backups.

I am using to backup my Linux servers as well as Windows desktops.

You must log in to answer this question.

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