[plug] dd </dev/hda >/dev/hdb

Peter F Bradshaw pfb at users.sourceforge.net
Sun Dec 3 19:38:59 WST 2000


On Sat, 2 Dec 2000, Russell Steicke wrote:

> On Sat, Dec 02, 2000 at 12:19:03PM +0800, Peter F Bradshaw wrote:
> ....
> > (cd /; tar -cvpf - --exclude-from /no_copy .) | (cd /mnt/hdb; tar -xpf -)
> 
> When doing things like this, I find it safer to do
> 
>   (cd / && tar cvfp - ) | ( cd /mnt/hdb && tar xpf -)
> 
> ie replace the ';' with '&&', so the tars will only run if the cds are
> successful.  This prevents tar doing damage in the event of a typo in one
> of the cd commands.

Yes. Good point.

Cheers

--
Peter F Bradshaw          | http://members.dingoblue.net.au/~pfb
pfb at users.sourceforge.net | PGP public key at
http://www.pfb.tsx.org    | http://members.dingoblue.net.au/~pfb/public_key.html
ICQ 75431157 (exadios)    | "Needs more salt" - Archimedes





More information about the plug mailing list