Subject: Re: copying entire directory to another filesystem
To: Brett Lymn <blymn@baesystems.com.au>
From: Herb Peyerl <hpeyerl@beer.org>
List: current-users
Date: 05/23/2000 05:00:55
blymn@baesystems.com.au (Brett Lymn)  wrote:
 > According to Thilo Manske:
 > >
 > >Anyway, I use dump|restore:
 > >dump 0f - <dir1>|(cd <dir2>;restore xf -)
 > >
 > 
 > dump 0f - <dir1>|(cd <dir2> && restore xf -)
 > 
 > otherwise if you botch the <dir2> argument you may end up restoring
 > into your current working directory.  Admittedly this is not 100%
 > foolproof because it will function if the fumbled <dir2> exists but it
 > does give a bit of extra insurance.

Sorry for perpetuating an inappropriate thread but.....

The original poster asked how to copy a "directory" to another filesystem.

It's not clear that he meant "....and preserve the source directory path 
relative to the top of the filesystem on the destination...."

	dump 0f - /var/spool/news/alt/binaries/pictures/erotica/fish | \
	(cd /home/foo/fish && restore -xf - )

....will probably give him: 

	/home/foo/fish/news/alt/binaries/pictures/erotica/fish/

....as opposed to:

	pax -wr -pe /var/spool/news/alt/binaries/pictures/erotica/fish /home/foo

which will do TRT.


and yes, I also use dump|restore when I'm mirroring a filesystem on another
disk...