LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 09-15-2011, 11:03 AM   #1
pmorin
Member
 
Registered: Jun 2011
Posts: 40

Rep: Reputation: Disabled
Question 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 ?
Code:
sudo tar pzcvf /media/BackupHDD/allServerBackup.tgz /
Thanks.

Regards,
Pierre
 
Old 09-15-2011, 11:22 AM   #2
ZeroDaHero
LQ Newbie
 
Registered: Jun 2007
Distribution: Slackware 13.1, Slackware64 13.1
Posts: 26

Rep: Reputation: Disabled
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!

http://www.nongnu.org/rdiff-backup/
 
Old 09-15-2011, 04:46 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
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.
 
Old 09-16-2011, 03:45 AM   #4
pmorin
Member
 
Registered: Jun 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 09-16-2011, 04:50 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
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. http://www.fsarchiver.org/Live-backup

Last edited by jefro; 09-16-2011 at 04:54 PM.
 
Old 09-16-2011, 06:59 PM   #6
etech3
Senior Member
 
Registered: Jul 2009
Location: Virginia
Distribution: Debian Stable Testing Sid Slackware CentOS
Posts: 1,055
Blog Entries: 2

Rep: Reputation: 44
You may want to take a look at mondoarchive. I have used it on LAMP+asterisk for a number of years with no problems.
 
Old 09-19-2011, 04:01 AM   #7
pmorin
Member
 
Registered: Jun 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
@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 ?
 
Old 09-28-2011, 06:05 AM   #8
pmorin
Member
 
Registered: Jun 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
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 ?
Quote:
sudo tar -xpf /media/BackupHDD/allServerBackup.tgz
Thank you.
Pierre

Last edited by pmorin; 09-28-2011 at 06:07 AM.
 
Old 09-28-2011, 08:00 AM   #9
snooly
Member
 
Registered: Sep 2011
Posts: 124

Rep: Reputation: Disabled
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.
 
Old 09-28-2011, 08:12 AM   #10
pmorin
Member
 
Registered: Jun 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
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 ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create a backup cd while running a livecd of ubuntu 10.04 paintitblack756 Linux - Desktop 2 06-02-2011 11:40 PM
Taking backup of running ubuntu desktop tkmsr Linux - Laptop and Netbook 3 10-17-2010 05:03 AM
Ubuntu Make a Mirror Backup viper3two Linux - Newbie 2 05-20-2010 01:55 PM
backup question - NFS share in Ubuntu 9.04 backup to READYNAS NV+ newellrp1 Linux - Newbie 3 05-19-2009 04:57 PM
Using RSync to backup a secondary off-site backup server pezdspencer Linux - Software 4 06-29-2007 04:40 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration