[KLUG Members] quick tar question

Tony Gettig members@kalamazoolinux.org
Wed, 11 Jul 2001 18:21:36 -0400


Thanks Bruce! Your presentation way back when (on the klug website), LDP, and the klug message archive helped me construct the command. I guess I was close. :) I'm testing NDS for Linux and am very close to success. Heck, I might even be able to present on it when the wounds heal (if there's interest). :) I like to start with a clean environment each time I try something different and reinstalling takes too long. Thanks again!

Tony


<<< Bruce Smith <bruce@armintl.com>  7/11 12:52p >>>

> I'm doing a lot of testing and potential trashing of a  Linux system and would like to get back to an original running state quickly. So I figured I could just create a tar of the / partition to my /data partition. Here's the command line I'm using (compiled from reading various bits at LDP and other sites):
> 
> tar -cplf /data/full.tar --directory / --exclude=proc --exclude=mnt --exclude=*/lost+found .
> 
> Partitions on the box are:
> 
> /
> /home
> /data
> 
> Is there a better way of accomplishing this? Now that I think about it, I could probably have excluded /home too. TIA for any pointers.

You don't need to "--exclude" anything in the above example.

The "l" (lowercase "L") option tells tar not to cross mount points,
so it will not backup /home, /data, /proc, or any other partition.
/lost+found should be an empty directory, so it only takes a few bytes.

Also be careful with "*" in your command lines.  They will expand
BEFORE the command is executed if possible.  If you really need to
send a command a "*", put it in single quotes.

If you need to save disk space on /data, you can give tar the "z"
option to have it gzip your backup file.  (at the expense of the
CPU, and it might take longer for the backup to run).

--------------------------------------------
Bruce Smith                bruce@armintl.com
System Administrator / Network Administrator
Armstrong International, Inc.
Three Rivers, Michigan  49093  USA
http://www.armstrong-intl.com/
--------------------------------------------
_______________________________________________
Members mailing list
Members@kalamazoolinux.org