-   Linux - Software (
-   -   What is the best backup method to make a backup of a running Ubuntu server ? (

pmorin 09-15-2011 10:03 AM

What is the best backup method to make a backup of a running Ubuntu server ?
Hi !

I would like to know what is the best way to make a backup of my server's partition.
I need those conditions to be fulfilled :
- I could run the backup while the server is running
- I'll have an image of the system with all files permissions, dates (modification date, creation date, etc...) and other file properties
- I'll be able to restore all the image in the partition
- I'll be able to restore some specific files at any time

Optionnal :
- the backup can be compressed (using GZip, for exemple)

Is the following command can be enougth ?

sudo tar pzcvf /media/BackupHDD/allServerBackup.tgz /


ZeroDaHero 09-15-2011 10:22 AM

One of the best backup 'tools' that I've ever used is rdiff-backup. Just stick that on a cron job and that should take care of most everything you need!

jefro 09-15-2011 03:46 PM

There was only one backup that could do a true live state I think in linux. It was on a prior post someone listed. Some apps like databases and other web and transactions programs are difficult to backup live.

I might be tempted to rely on a hardware raid 5 or better instead.

pmorin 09-16-2011 02:45 AM

Thank you ZeroDaHero ! But it seems to not correspond to my needs. I don't need an incremental backup, since I will do this backup only once, or rarely.

@jefro : Thank you, too !
Are you talking about a backup using "dd" ? I didn't used it but can it be used to create image files of the partition ? And can we restore only one file of the backup, if needed ?
For databases backup : that's not a problem for me, since I make regular backups of it.

Using "tar" is not a good solution ?

jefro 09-16-2011 03:50 PM

It wasn't dd it was either a commercial or OSS program that claimed to do live state backups. dd would backup but as to the actual condition of programs it may render a false image. Depends on what you have running. I meant that transactions needed to be taken into account. For example a database may be involved in 1000's of transactions while this dd takes place. So which copy would be the correct one?

It would be best to stop all programs then make a backup if you can can. dd, tar, rsync, partimge, clonzilla, cpio and others may suite your needs.

Some OS's and some filesystems may be better suited to live snapshots.

Look at this for some ideas on a live state image.

etech3 09-16-2011 05:59 PM

You may want to take a look at mondoarchive. I have used it on LAMP+asterisk for a number of years with no problems.

pmorin 09-19-2011 03:01 AM

@jefro : Thank you for your advice. Don't worry about the database.
This backup is not aimed to restore the system. It's important that it can provide such restoration, but it will mainly be used to restore some configuration files if needed.
So, if you say that "tar" can suite my needs, I think I'll use it.

@etech3 : Thank you ! mondoarchive seems nice, but what are the benefits over tar ?

pmorin 09-28-2011 05:05 AM

It seems that, in my case, tar could be a good solution, so I will use it for my backups.

If I execute this on an empty ext4 partition, is this partition will be bootable ?

sudo tar -xpf /media/BackupHDD/allServerBackup.tgz
Thank you.

snooly 09-28-2011 07:00 AM

Tar is good, and probably untarring like that would produce "something". But as for it being bootable, you're probably dreaming! You still would need to set up the bootloader, and you have to accept that tar isn't magic, and there might be various stuff like databases that might not work. But at least tar can get you most of the way there. You might also like rsync, which can make a copy, and can then just copy the changes if you run it again.

pmorin 09-28-2011 07:12 AM

I'm aware that Tar isn't magic and that databases could not work, but that very last point isn't a problem for me : I've got some frequent backups of it.

rsync is a good solution, but it can't make archives.

What is a good solution to have a "bootable" backup of a Linux install ?

I know that, for Mac OS X, we just need to make a full backup of the partition, using rsync for example.
In my case, a solution could be to create a compressed disk image, mount it and make an rsync on it. Is that possible on Linux ?

All times are GMT -5. The time now is 03:02 AM.