[ale] Making a backup with tar

Stephan Uphoff ups at tree.com
Wed Jan 19 16:23:33 EST 2005


On Wed, 2005-01-19 at 15:49, Christopher Fowler wrote:
> On Wed, 2005-01-19 at 15:32, Stephan Uphoff wrote:
> > On Wed, 2005-01-19 at 15:15, Christopher Fowler wrote:
> > > tar -cjpslf /bu/FC2-SAM-011905.tar.bz2 /bin/ /boot/ /dev/ /etc/ /home/
> > > /initrd/ /lib/ /lost+found/ /misc/ /mnt/ /opt/ /proc /root/ /sbin/
> > > /selinux/ /sys /tmp /usr /var
> > ------------^^^^
> > 
> > Try removing /sys from you command line ;-)
> > 
> 
> Yep.  How do I omit a directory.  /bu is on root and I do not want  /bu
> backed up

( cd / ; tar -cjl --exclude  ./bu  -f /bu/FC2-SAM-011905.tar.bz2 ./)
tar -cjl --exclude  /bu  -f /bu/FC2-SAM-011905.tar.bz2 /

another important command is "man tar" ;-)

	Stephan


> > > 
> > > tar: /sys/class/netlink/skip/dev: File shrank by 0 bytes; padding with
> > > zeros
> > > tar: /sys/class/netlink/route/dev: File shrank by 3072 bytes; padding
> > > with zeros
> > > 
> > > Maybe one of my command-line options is negating the use of -l ?
> > > 
> > > 
> > > On Wed, 2005-01-19 at 14:39, Stephan Uphoff wrote:
> > > > On Wed, 2005-01-19 at 14:21, Christopher Fowler wrote:
> > > > > I tried the -l option and it seemed that tar did not understand that
> > > > > /sys was a different filesystem. I saw it walking that directory trying
> > > > > to add those files.  /sys is sysfs.
> > > > 
> > > > Works on my laptop.
> > > > 
> > > > sunburn:/# tar clvf /dev/null ./
> > > > ./sys/
> > > > tar: ./sys/: file is on a different filesystem; not dumped
> > > > 
> > > > 
> > > > sunburn:/# stat /
> > > >   File: `/'
> > > >   Size: 4096            Blocks: 8          IO Block: 4096   directory
> > > > Device: 302h/770d       Inode: 2           Links: 21
> > > > Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
> > > > Access: 2004-05-05 07:35:04.000000000 -0400
> > > > Modify: 2004-05-13 11:51:46.000000000 -0400
> > > > Change: 2004-05-13 11:51:46.000000000 -0400
> > > > 
> > > > sunburn:/# stat /sys/
> > > >   File: `/sys/'
> > > >   Size: 0               Blocks: 0          IO Block: 4096   directory
> > > > Device: 0h/0d   Inode: 1           Links: 8
> > > > Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
> > > > Access: 2005-01-19 14:26:21.000000000 -0500
> > > > Modify: 2005-01-11 12:32:29.000000000 -0500
> > > > Change: 2005-01-11 12:32:29.000000000 -0500
> > > > 
> > > > sunburn:/# uname -a
> > > > Linux sunburn 2.6.5 #1 Mon May 3 17:45:45 EDT 2004 i686 GNU/Linux
> > > > 
> > > > sunburn:/# tar --version
> > > > tar (GNU tar) 1.13.93
> > > > Copyright (C) 2003 Free Software Foundation, Inc.
> > > > This program comes with NO WARRANTY, to the extent permitted by law.
> > > > You may redistribute it under the terms of the GNU General Public
> > > > License;
> > > > see the file named COPYING for details.
> > > > Written by John Gilmore and Jay Fenlason.
> > > > 
> > > > > 
> > > > > On Wed, 2005-01-19 at 13:56, Stephan Uphoff wrote:
> > > > > > --preserve on extraction always worked for me.
> > > > > > 
> > > > > > I recommend creating a backup file per file system with -l or
> > > > > > --one-file-system using a relative path.
> > > > > > 
> > > > > > 	(cd /  ; tar cjvlf tarfile1.bz2 ./)
> > > > > > 	(cd /usr ; tar cjvlf tarfile2.bz2 ./)
> > > > > > 
> > > > > > makes it easier to install from bare metal.
> > > > > > 
> > > > > > 
> > > > > > On Wed, 2005-01-19 at 12:46, Christopher Fowler wrote:
> > > > > > > I'm trying to create a file system backup using 'tar -cjpsvf
> > > > > > > /bu/full.tar.bz2 /bin /boot /opt /home ...'.  When I extract the files
> > > > > > > they are all owned by root.  Should I use the '--same-owner' option on
> > > > > > > extraction?
> > > > > > > 
> > > > > > > Chris
> > > > > > > 
> > > > > > > 
> > > > > > > _______________________________________________
> > > > > > > Ale mailing list
> > > > > > > Ale at ale.org
> > > > > > > http://www.ale.org/mailman/listinfo/ale
> > > > > > > 
> > > > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > 
> > > 
> > > 
> 
> 
> 



More information about the Ale mailing list