Mirror Incremental Backup

Ok, here is my problem. I have several servers that need daily backup. The amount of data and server configuration doesn’t allow me to do full backup every time. Now I would need some sort of incremental backup that in the end will be a true mirror of the site. If a file is deleted from the server, I need it deleted from the backup as well. Does incremental backup do that? Or does it just backup new and updated files? Cause of the nature of the sites and site scripts, files that no longer need to be on the server must be out of backup, so in case that I restore the server from backup I don’t restore the deleted files. And by amount of files changing on the server, keeping copy of deleted files might also overload my backup storage space.

If you really need a mirror of your server, you’ll need to use a mirroring tool, like rsync, rather than a backup system. Backups from Webmin and Virtualmin are either tar archives or compressed dumps, and are not in a usable form on the backup device.

rsync can delete extra files that have since been removed from the source system (–delete option). This can be accomplished using this (which is a slightly modified example from the rsync man page):

rsync -az -e ssh --delete /home/* destserver:"/home/"

This says to use archive mode to copy files from /home on the current server to /home on destserver, using compression for the transfer (the other server will always have an uncompressed duplicate of the source that will take identical space), using ssh as the transfer protocol, deleting any extra files on the destination that don’t exist on the source.

Of course, I failed to explain that this isn’t going to copy over the Virtualmin configuration or any of your Apache/Postfix/etc. configuration files. You’ll need to solve those problems, as well…depending on how you plan to do takeover of service in the event of any outage, you may be able to use rsync on some of the files in /etc, directly. IP takeover is probably the easiest to achieve, and I’ve talked a bit about the topic a few times here in the forums.

Well what I really need is a backup that in case of server failure I can use to reconstruct the version of sites backuped within last few hours. We are makeing a backup copy of our sites to another disk on the same server every few hours. In case of main disk failure, we have a new disk at the office, outside of server, installed with Webmin, Usermin and Virutalmin, and we just need to replace it with failed main disk and do a backup from the backup disk with all sites settings (settings a Virtualmin is capable of backing up). Of course, in case that backup disk dies first, we stop the server, put a new backup disk in, and get the server up and running again. The nature of the sites allows us to have server down even for a 2-3 days if really necessary while restoring the sites and backup. The best thing would be if we could just tell Virtualmin to load all settings and files back in case the main disk died. I might be asking a bit too much, but hey… people at my country say that it is always good to ask :slight_smile: … something like “Who asks doesn’t get lost” :slight_smile:


The best thing would be if we could just tell Virtualmin to load all settings and files back in case the main disk died. I might be asking a bit too much

Well, you can get pretty close :slight_smile:

Three things:

  1. If you have Virtualmin backups of your Virtual Servers, you can simply point Virtualmin at the directory of backup files and have it restore it all at once (ie, you don’t have to do them each individually). That will restore all your Virtual Servers and all of their respective settings.

  2. If you also have a more recent copy of /home somewhere (perhaps using Joe’s rsync example above), you can then use rsync to pull the more recent data back onto the server you’re restoring to.

  3. You can also use Virtualmin to backup/restore system config file data. If you log into Virtualmin, and click Webmin -> Webmin -> Backup Configuration Files, you can have it back up any of the configs it’s managing.