[CentOS] tar question

Jay Leafey jay.leafey at mindless.com
Thu Jun 7 21:06:46 UTC 2007


Matt Hyclak wrote:
> On Thu, Jun 07, 2007 at 02:11:23PM +0100, Tom Brown enlightened us:
>> Using tar i normally create an archive etc and then unpack that archive, 
>> job done.
>>
>> But i am copying from one filesystem to another on the same host, they 
>> are 2 seperate nfs filesystems, and i wonder is it possible to use tar 
>> to do this as opposed to say rsync etc.
>>
>> tar -cvf /some/input/dir to/here etc ?
>>
> 
> I believe it goes something like:
> 
> cd /some/input/dir 
> tar cvf - . | (cd /to/here; tar xvf -)
> 
> Matt
> 

Or you could think "outside the tar box" and use cpio:

cd /some/input/dir
find . | cpio -pmvd /some/destination/dir

"-p" invokes the "passthru" mode, which is great for doing 
filesystem-to-filesystem copies.  cpio seems to have been installed on 
just about every CentOS, Fedora, and RH system I've used in the last 
several years.  See the manpage for more info!
-- 
Jay Leafey - Memphis, TN
jay.leafey at mindless.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5177 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.centos.org/pipermail/centos/attachments/20070607/ea49939d/smime.bin


More information about the CentOS mailing list