Hi Malcolm,

On Sun, Jul 01, 2007 at 07:09:42PM +0100, Malcolm Hunter wrote:
> 
> On Sun, July 1, 2007 7:04 pm, Andy Smith wrote:
> > $ (cd /home && tar pcf - .) | (cd /mnt/tmphome && tar pxvf -)
> 
> I don't understand. What's wrong with sudo cp -a /home /mnt/tmp/home ?

I am not sure of the exact status of gnu cp right now, but cp
historically does not handle file attributes, links, special files,
device files, sparse files etc. etc. properly.  I am sure given the
correct options you can do this with cp, but for me it is preferable
to use tar as I need to remember fewer options.

Also it is faster over a larger number of files, and more amenable
to pipelining with other tools such as compression or doing it
across a network:

(cd /home && sudo tar zpcf - .) | ssh otherhost 'cd /home && tar zpxvf -')

so I would rather use this more general solution and save the space
in my head for other things.

Cheers,
Andy

-- 
http://bitfolk.com/ -- No-nonsense VPS hosting
Encrypted mail welcome - keyid 0x604DE5DB

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro

Reply via email to