Amanda-Users

RE: moved to new disk, now amanda wants to do level 0's on whole system

2003-11-17 00:22:58
Subject: RE: moved to new disk, now amanda wants to do level 0's on whole system
From: "Dana Bourgeois" <em-lists AT netgods DOT us>
To: "'Eric Siegerman'" <erics AT telepres DOT com>, <amanda-users AT amanda DOT org>
Date: Sat, 15 Nov 2003 01:38:49 -0800
Sun's tar used to have a bug where it wouldn't copy more than like 25 levels
of directories.  I first ran across this under SunOS but heard that as of
about Solaris 2.6 the bug is gone.  YMMV


Dana Bourgeois


> -----Original Message-----
> From: owner-amanda-users AT amanda DOT org 
> [mailto:owner-amanda-users AT amanda DOT org] On Behalf Of Eric Siegerman
> Sent: Friday, November 14, 2003 12:08 PM
> To: amanda-users AT amanda DOT org
> Subject: Re: moved to new disk, now amanda wants to do level 
> 0's on whole system
> 
> 
> On Fri, Nov 14, 2003 at 09:20:23AM -0500, Jay Fenlason wrote:
> > Also, cp/fr may not have correctly reset the modification 
> times of the 
> > files when it copied them.  Oh, and they may not handle links well 
> > either.  To copy directory trees, I usually use "( cd 
> /fromdir ; tar 
> > cf - . ) | ( cd /todir ; tar xpf -)", which preserves modification 
> > times, and permissions.
> 
> I've had problems with tar, too.  Unfortunately, that was so 
> long ago that I forget what they were.  Maybe it stores only 
> mtime in the tarball, and on extraction sets both mtime and 
> atime to the saved mtime value.  Oh, and I think it likes to 
> (try to) copy the contents of special files, FIFOs, and the 
> like, instead of recreating them in the destination tree.
> 
> Until recently, I used the cpio variant of your suggestion:
>       cd /fromdir
>       find . -depth -print0 | cpio -padmu0 /todir
> (You need GNU find and cpio for the "0" part to work.  -depth 
> is to get the directories' mtimes copied properly.  It makes 
> each directory come *after* its contents in the file listing. 
>  Without -depth, the directory would come first; cpio would 
> properly set its mtime, and then stomp on it by creating the 
> directory's
> contents.)
> 
> But then I discovered rsync.  Rsync rocks.  "rsync -aH" 
> copies everything the kernel lets you copy (i.e. not ctimes, 
> and not inumbers).  The only problem with rsync is the weird 
> way it gives meaning to a trailing slash; these two are *not* 
> equivalent:
>       rsync -aH srcdir/ destdir
>       rsync -aH srcdir destdir
> 
> Then again, I'm not sure whether either cpio or rsync can 
> deal with a username that's changed its numerical userid, or 
> similarly for groups.  I think some tar's can.  Or maybe it's 
> cpio that can handle that; can't remember.  And gtar probably 
> doesn't have any of those problems -- people are using it for 
> backups after all
> :-) -- but it's not always available, and even non-GNU cpio's 
> do everything but the "0" trick.
> 
> But all of those -- tar, cpio, rsync -- are kludges.  Is it 
> just me, or do other people also find it ludicrous that 30+ 
> years on, UNIX still doesn't have a proper copy command?
> 
> --
> 
> |  | /\
> |-_|/  >   Eric Siegerman, Toronto, Ont.        erics AT telepres DOT com
> |  |  /
> It must be said that they would have sounded better if the 
> singer wouldn't throw his fellow band members to the ground 
> and toss the drum kit around during songs.
>       - Patrick Lenneau
> 
>