1833648 Members
4409 Online
110062 Solutions
New Discussion

Command

 
Adrianne Hoang
Occasional Advisor

Command

Hello!

I am trying to move the directories and files from hp-ux 11.0 to hp-ux 11i. What command should i used? I can do rcp for moving files but not for directories via remote.

Please advise,
Adrianne
7 REPLIES 7
Jaime Bolanos Rojas.
Honored Contributor

Re: Command

Adriane, I would recommend you to use fbackup/frecover to move data, also you can use tar to do the job, if you have really big files, there is a patch to support files bigger than 2 GB's.

Regards,

jaime.
Work hard when the need comes out.
Steven E. Protter
Exalted Contributor

Re: Command

Shalom,

usually rcp -rp will move files and directories, tough what it is really doing is copying them, which is better anyway.

Make sure your system is patched becuase I've seen errors with rcp -rp

scp -rp is better. More reliable and secure

tar copy across and untar is best because it does the best job preserving permissions.

Don't forget to migrate your users if you use /etc/passwd file authentication.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Adrianne Hoang
Occasional Advisor

Re: Command

Thank you. I will will take your advice.

Sincerely,
Adrianne
Marvin Strong
Honored Contributor

Re: Command

I prefer tar or cpio across the network to rcp.

something like:

(cd /source; find . -xdev | cpio -o | ssh destination "cd /target && cpio -idumv")
Adrianne Hoang
Occasional Advisor

Re: Command

Under root:

/>>rcp -rp /procedures hostname: /procedurces

Do I need to mkdir first or i can just move the everything over?

Thanks,
Adrianne
TwoProc
Honored Contributor

Re: Command

I prefer tar, because it does the best job of preserving permissions (as mentioned above).

It's pretty simple using tar and ssh across the two machines.

from source machine:

cd /sourcedir
tar cvf - . | ssh destmachine "cd /destdir; tar xvf - "

If you don't have ssh configured (and you should) you can remsh just as easily as above, just substitute the "ssh" part for "remsh" - works pretty much same way.

We are the people our parents warned us about --Jimmy Buffett
A. Clay Stephenson
Acclaimed Contributor

Re: Command

Tar and cpio have one inherent drawback and that is maximum filesize (8GiB for a patched version of tar and 2GiB for cpio); the better alternative is to construct your remsh (or ssh) pipeline using fbackup and frecover. This will preserve all file attributes as well as handle large files with ease.
If it ain't broke, I can fix that.