LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-21-2007, 11:18 AM   #1
lebabyg
Member
 
Registered: Mar 2006
Location: UK
Distribution: Ubuntu Feisty
Posts: 272

Rep: Reputation: 30
Backup and restore system.... tar.gz?


Hi Guys,

Now that my linux box has got above 8months in maturity, I really don't want to have to do a fresh install should something go wrong....

For this reason, how can i back up my system without using something like mondo or commercial software like norton ghost.

I was thinking about simply compressing my whole / into a .tar file and burning it to DVD. Will this work? If so, do i need to exclude any files (/dev /proc /tmp??) and how do i go about this? I do not have enough space on my main drive so would like to create the .tar file direct onto an external USB hard drive.....

Any help is appreciated, and if i can get this to work i'll write a short wiki on it....
 
Old 09-21-2007, 01:03 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by lebabyg View Post
Hi Guys,

Now that my linux box has got above 8months in maturity, I really don't want to have to do a fresh install should something go wrong....

For this reason, how can i back up my system without using something like mondo or commercial software like norton ghost.

I was thinking about simply compressing my whole / into a .tar file and burning it to DVD. Will this work? If so, do i need to exclude any files (/dev /proc /tmp??) and how do i go about this? I do not have enough space on my main drive so would like to create the .tar file direct onto an external USB hard drive.....

Any help is appreciated, and if i can get this to work i'll write a short wiki on it....
I back up my system the way that you describe. Rather than put all of / in one tarball I put each of the base directories (/etc, /var, /usr and so on) in tarballs. If you try to tar /proc you will get an error message that does not stop the backup. Backing up /tmp is a waste of time.

I have a script which tars the files, creates an iso file system in a spare partition, and then uses cdrecord to burn a CD backup. Actually it takes 3 CDs to back everything up so I have three scripts.

---------------------
Steve Stites
 
Old 09-21-2007, 05:19 PM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Your solution lies within this thread.
 
Old 09-22-2007, 03:30 PM   #4
lebabyg
Member
 
Registered: Mar 2006
Location: UK
Distribution: Ubuntu Feisty
Posts: 272

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jailbait View Post
I back up my system the way that you describe. Rather than put all of / in one tarball I put each of the base directories (/etc, /var, /usr and so on) in tarballs. If you try to tar /proc you will get an error message that does not stop the backup. Backing up /tmp is a waste of time.

I have a script which tars the files, creates an iso file system in a spare partition, and then uses cdrecord to burn a CD backup. Actually it takes 3 CDs to back everything up so I have three scripts.

---------------------
Steve Stites
Don't suppose that i could be really cheeky and ask for the scripts . I'm not proficient (or confident) enough in programming to write a workable script.... (grovels and looks hopeful)

Cheers
 
Old 09-22-2007, 04:22 PM   #5
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Quote:
Originally Posted by Junior Hacker View Post
Your solution lies within this thread.
More specifically, #6 is probably what you are talking about:
http://www.linuxquestions.org/questi...67&postcount=6

Last edited by Micro420; 09-22-2007 at 04:24 PM.
 
Old 09-23-2007, 02:05 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by lebabyg View Post
Don't suppose that i could be really cheeky and ask for the scripts . I'm not proficient (or confident) enough in programming to write a workable script.... (grovels and looks hopeful)

Cheers
Here is one of the scripts. The other two are similar enough that there is no point in posting all three.


http://www.linuxquestions.org/questi...d.php?t=171362

-----------------
Steev Stites
 
Old 09-25-2007, 09:05 AM   #7
lebabyg
Member
 
Registered: Mar 2006
Location: UK
Distribution: Ubuntu Feisty
Posts: 272

Original Poster
Rep: Reputation: 30
Cheers Jailbait.

This doesn't back up the entire system tho does it? Also how hard is it to restore afterwards? For example, if i tarred by home directory in the same way, and then did a fresh install on another machine, could i then just untar the backups i'd made and this would restore things exactly....
 
Old 09-25-2007, 09:11 PM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by lebabyg View Post
Cheers Jailbait.

This doesn't back up the entire system tho does it? Also how hard is it to restore afterwards? For example, if i tarred by home directory in the same way, and then did a fresh install on another machine, could i then just untar the backups i'd made and this would restore things exactly....

It takes 3 CDs to hold my entire backup. This script produces the first CD. The other 2 scripts get the remainder of the system.

Yes, you restore using tar.

------------
Steve Stites
 
Old 09-27-2007, 05:06 AM   #9
lebabyg
Member
 
Registered: Mar 2006
Location: UK
Distribution: Ubuntu Feisty
Posts: 272

Original Poster
Rep: Reputation: 30
Sorry Steve,

You must be getting exasperated at this point, but i want to get this right

1. I take it the other 2 CDs include the omitted directories /srv /sys /usr (at least on my ubuntu system these seem to be the ones ommitted from your script)
2. Should i (or is it not possible) to include /media /mnt /proc and should i include links to the backup files of initrd.img and initrd.img.old??

Thanks for your patience.
Cheers
 
Old 09-27-2007, 11:23 AM   #10
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
1. Yes.

2. If you tar /media or /mnt then you will backup whatever removable file systems you happen to have mounted when you do the backup. So don't backup /media and /mnt.

The contents of /proc are not really files. They are pointers to entry points in the kernel. If you try to tar /proc you will get an error message and tar will skip over /proc.

------------------
Steve Stites
 
Old 09-28-2007, 09:16 AM   #11
lebabyg
Member
 
Registered: Mar 2006
Location: UK
Distribution: Ubuntu Feisty
Posts: 272

Original Poster
Rep: Reputation: 30
Cheers.

Will have a go at that....
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Backup and Restore with TAR jay2809 Linux - Newbie 7 08-25-2004 04:47 PM
tar to restore backup -- goes to sleep?!? JZL240I-U Linux - Software 4 05-10-2004 02:55 AM
backup and restore using tar AZDAVE Linux - General 6 11-28-2003 08:40 PM
how can I restore a tar backup len snelly Linux - Newbie 1 04-30-2002 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:10 PM.

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
Open Source Consulting | Domain Registration