Showing posts with label cpio. Show all posts
Showing posts with label cpio. Show all posts

13 August 2014

Copy files between 2 remote servers using cpio.

ssh rhost1 "find dir | cpio -ocB" | ssh rhost2 "cd rdir2;cpio -ivB "

18 August 2009

cpio examples

To create an archive
find . | cpio -ocvB > x.cpio

Read an archive:
cpio -itcvB -I x.cpio

Read a file from archive:
cpio -itcvB -I x.cpio ".ssh/known_hosts"

Restore the file (remove the t option).
cpio -icvB -I x.cpio ".ssh/known_hosts"