Re: Using tar to backup my system

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Dave Nebinger
> # tar -zcvf /backup/mylaptop.tar /[all directories] except /backup (as I
> don't want to go in circles).

You're going to want to exclude portions of /var, /dev, /proc & /sys, /tmp,
...  You're also going to want to dig deeper into command line options to
preserve ownership, links rather than hard files, etc.

> # tar -zxvf mylaptop.tar

Ah, -z isn't needed because mylaptop.tar is not compressed.  The other
larger problem is that it overwrites all files, regardless of whether they
have been updated or not.

I guess really what I'm saying is no, it is not a good idea.  There's plenty
of other backup solutions out there that would work better than this scheme.
If you have a server and space for the file, rsync would even be a better
solution.

--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

JesseZhao
2005/11/4, Richard Watson <[hidden email]>:

> # tar -zcvf /backup/mylaptop.tar /[all directories] except /backup (as I
> don't want to go in circles).
>
> I'm then going to copy off the resulting tarball to my server in case my
> laptop dies (I'd rather not have to recompile everything). Does this
> sound OK?If I ever had to restore I would copy the file to / and run the
> command.
>
> # tar -zxvf mylaptop.tar

 tar cjpf /path/to/save/at/stage4.tar.bz2 / --exclude=stage4.tar.bz2
--exclude=/backup
please make sure use the p paramters,it is keep the property of backup files





--
/****************************************
* Love in Gentoo-Linux  C and Python           *
* Look at my blog                                          *
* http://poorc.wordpress.com                       *
****************************************/

--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Richard Watson
In reply to this post by Dave Nebinger

On Thu, 2005-11-03 at 19:41 -0500, Dave Nebinger wrote:
> I guess really what I'm saying is no, it is not a good idea.  There's plenty
> of other backup solutions out there that would work better than this scheme.
> If you have a server and space for the file, rsync would even be a better
> solution.

I'm going to try something I found on the Gentoo Wiki:

# emerge netcat

Remote machine runs
# nc -l -p 10000 > image.gz

Machine I'm backing up:
# dd if=/dev/hda1 | gzip | nc -w 5 remote_ip 10000

What do you think? I'm a bit puzzled by rsync at the moment so this
seems to be a simple short term fix. Thanks, Richard




--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Neil Bothwick
In reply to this post by Dave Nebinger
On Thu, 03 Nov 2005 19:41:19 -0500, Dave Nebinger wrote:

> I guess really what I'm saying is no, it is not a good idea.  There's
> plenty of other backup solutions out there that would work better than
> this scheme. If you have a server and space for the file, rsync would
> even be a better solution.

I you go down this road, I would recommend rdiff-backup. It has all the
advantages of rsync (it uses librsync) but adds much more. For example, it
keeps diffs when files change, so when you realise you've messed up your
Apache config, you can restore the file you were using x days ago.


--
Neil Bothwick

Newsflash! Explosion at M$ beta testsite - Infinite number of monkeys
killed.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Bugzilla from volker.armin.hemmann@tu-clausthal.de
In reply to this post by Dave Nebinger
On Friday 04 November 2005 01:44, Richard Watson wrote:

> Hi ... I've just spent ages compiling my laptop. I'm really happy with
> the result ... So fast ...
>
> What I want to is create a directory called /backup and then create a
> tarball using the command
>
> # tar -zcvf /backup/mylaptop.tar /[all directories] except /backup (as I
> don't want to go in circles).
>
> I'm then going to copy off the resulting tarball to my server in case my
> laptop dies (I'd rather not have to recompile everything). Does this
> sound OK?If I ever had to restore I would copy the file to / and run the
> command.
>
> # tar -zxvf mylaptop.tar
> --
> Thanks, Richard


you need to --exclude /proc, or you'll run into problems.
You should exclude /sys, /dev/, /tmp and /var/run
--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Neil Bothwick
On Fri, 4 Nov 2005 14:29:17 +0100, Hemmann, Volker Armin wrote:

> you need to --exclude /proc, or you'll run into problems.
> You should exclude /sys, /dev/, /tmp and /var/run

And /sys and much of /mnt or /media. It's probably best to use the
--one-filesystem option and specify the directories you do want

tar --one-filesystem -czf /backup/name.tar.gz / /home /any/other/partition/


--
Neil Bothwick

"I'm Not Sure If I'm Homosexual", Said Tom, Half In Earnest.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

capsel
Or maybe bind / to a subdir and tar from it. It's like
--one-filesystem but it works always (for me).

2005/11/4, Neil Bothwick <[hidden email]>:

> On Fri, 4 Nov 2005 14:29:17 +0100, Hemmann, Volker Armin wrote:
>
> > you need to --exclude /proc, or you'll run into problems.
> > You should exclude /sys, /dev/, /tmp and /var/run
>
> And /sys and much of /mnt or /media. It's probably best to use the
> --one-filesystem option and specify the directories you do want
>
> tar --one-filesystem -czf /backup/name.tar.gz / /home /any/other/partition/
>
>
> --
> Neil Bothwick
>
> "I'm Not Sure If I'm Homosexual", Said Tom, Half In Earnest.
>
>
>

--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Neil Bothwick
On Fri, 4 Nov 2005 17:02:41 +0100, capsel wrote:

> Or maybe bind / to a subdir and tar from it. It's like
> --one-filesystem but it works always (for me).

Why go to the trouble of mounting / again when tar already has an option
to deal with this?

I don't doubt that it works, but it seems like a long-winded way of doing
things.


--
Neil Bothwick

Press any key to continue or any other key to quit

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Bugzilla from bigfish@asmallpond.org
Neil Bothwick wrote:

>On Fri, 4 Nov 2005 17:02:41 +0100, capsel wrote:
>
>  
>
>>Or maybe bind / to a subdir and tar from it. It's like
>>--one-filesystem but it works always (for me).
>>    
>>
>
>Why go to the trouble of mounting / again when tar already has an option
>to deal with this?
>
>I don't doubt that it works, but it seems like a long-winded way of doing
>things.
>

It has one major advantage regarding udev, in that some device nodes
(/dev/console, for example) must exist in the /dev directory on the root
filesystem, and when /dev is mounted and you use --one-filesystem, you
won't backup those nodes.  Binding / somewhere else let's you backup
what is really on the root filesystem, so you will restore those device
nodes when recovering from a live CD.

-Richard

--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Using tar to backup my system

Neil Bothwick
On Fri, 04 Nov 2005 11:29:51 -0700, Richard Fish wrote:

> It has one major advantage regarding udev, in that some device nodes
> (/dev/console, for example) must exist in the /dev directory on the
> root filesystem, and when /dev is mounted and you use --one-filesystem,
> you won't backup those nodes.  Binding / somewhere else let's you
> backup what is really on the root filesystem, so you will restore those
> device nodes when recovering from a live CD.

Good point.


--
Neil Bothwick

Real women don't have hot flashes, they have power surges.

signature.asc (196 bytes) Download Attachment