1819915 Members
2322 Online
109607 Solutions
New Discussion юеВ

cpio and rcp

 
SOLVED
Go to solution
Howard Marshall
Regular Advisor

cpio and rcp

Could someone help me out here. I have forgotten how to do this its been so long sense I have done it.

I have a directory on machine A and want to duplicate it on machine B but don't have enough space to create a file archive and don't want to mess with a tape if I can help it.

I have done this before and I thought it was
find . -print | cpio -oam | rexec systemB cd /newdir ; cpio -idvam
but the pipe gets hung up on the change directory

could someone remind me what I am doing wrong or let me know another way to do this.

Thanks

Howard
6 REPLIES 6
Rick Garland
Honored Contributor
Solution

Re: cpio and rcp


Remote CPIO

find filesys -print | cpio -ocv | remsh remotehost "dd of=/dev/rmt/0m"

find filesys -print | cpio -ocv | remsh remotehost "dd of=/backup/system_a.cpio"

find . | cpio -oc | remsh remotehost "cd /newpath ; cpio -icdmuv"
Rick Garland
Honored Contributor

Re: cpio and rcp

Here is the same for vxdump/vxrestore

/usr/sbin/vxdump 0f - /dev/vg00/osymmgr | remsh luna '(cd /apps/osymmgr; /usr/sbin/vxrestore -rf -)'
/usr/sbin/vxdump 0f - /dev/vg00/openv | remsh luna '(cd /apps/openv; /usr/sbin/vxrestore -rf -)'
/usr/sbin/vxdump 0f - /dev/vgfin107/orahome | remsh $HOST '(cd /apps/aporacle107; /usr/sbin/vxrestore -rf -)'

/usr/sbin/vxdump 0f - /dev/vgfin107/appsmgr | remsh $HOST '(cd /apps/appsmgr107; /usr/sbin/vxrestore -rf -)'

/usr/sbin/vxdump 0f - /dev/vgfin107/custom | remsh $HOST '(cd /apps/custom107; /usr/sbin/vxrestore -rf -)'

James R. Ferguson
Acclaimed Contributor

Re: cpio and rcp

Hi Howard"

Try:

# find . -print | cpio -oam | rexec systemB ( cd /newdir ; cpio -idvam )

Regards!

...JRF...
Howard Marshall
Regular Advisor

Re: cpio and rcp

Thanks Rick

It was the remsh that I should have been using instead of rexec

Works like a champ.

Howard
Howard Marshall
Regular Advisor

Re: cpio and rcp

OK, I will figure the forum out eventually
Raj D.
Honored Contributor

Re: cpio and rcp

Hi Howard ,

You can also use , tar and gzip.

Here it is :
------------

At Server A:

# cd /somedir/yourdir
# tar -cvf mydir.tar *
# gzip mydir.tar

# scp mydir.tar.gz serverb:/home/howard


At Server B:

# cd /somedir
# mkdir yourdir
# cd yourdir
# cp /home/howard/mydir.tar.gz .
# tar -xvf mydir.tar

[Note: scp is available if ssh is installed , else rcp or ftp can be used to transfer the file. ]


Enjoy,
Cheers,
Raj.



" If u think u can , If u think u cannot , - You are always Right . "