network cpio using ssh

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm posting a helpful hint.
I'm using ksh on both ends, and personally I am going from a Solaris 9
to Solaris 8 host but that won't matter.

find patchdiag -print | cpio -oc | ssh sproot@cad-a  "(cd /usr/local; cpio
-icvdm "\)

The tricky things to getting this right are:
- shell escaping done on both ends
- network cpio, which isn't covered at all in Sun's cpio(1) manpage.
- Grouping the change directory with the restore.

I actually wrote a helpful hint to myself of this in '97 after it
took me several hours to work out.  Some of the command syntax changed
since then so I was updating the page today.  I figured I'd put it
out on Usenet for Google archiving.
I suppose one could add the -C option to the ssh command to turn
on compression.

Regards, Scott

Site Timeline