Operating System - HP-UX
1844118 Members
3003 Online
110227 Solutions
New Discussion

FTP/Copy from HP to Linux

 
Stuart Lloyd_2
Advisor

FTP/Copy from HP to Linux

HP10.20
Red Hat 9

Trying to copy a directory form HP to Linux and keep all of the permission sets intact. I have tried ftp but everything gets hosed on the transfer and root owns everything. I need to copy this directory and keep ALL of the owners/groups/permissions the same. I tried mounting the HP to the Linux and doing a cp... errors. I tried doing a tar... errors. Suggestions?
Charlie don't surf.
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: FTP/Copy from HP to Linux

tar would probably be your best bet. You must have the same users created on the linux box as on the HP-UX box with the same uid and gid numbers.

Since you don't say what errors you got, here is what I would do:

Dir you want to copy is /my/dir on the HP-UX machine

# tar -cvf /var/tmp/my.dir.tar /my/dir

FTP this tar archive to the linux box.

# cd /
# tar -xvf /var/tmp/my.dir.tar

This SHOULD recreate the file / directory ownerships and permissions as they were on the HP-UX machine.
John Poff
Honored Contributor

Re: FTP/Copy from HP to Linux

Hi,

The FTP program will create the files with the same ownership as the user running the ftp program, so it sounds like your are logged in as root on the Linux system.

I'm a big fan of using 'cpio' for these kinds of jobs. Use cpio on the HP side and redirect to a file, ftp that file over to Linux, and then use cpio on Linux to load it up. Do you have the same user accounts [and same UIDs] on the Linux box as you do for the files on the HP box?

JP
Steven E. Protter
Exalted Contributor

Re: FTP/Copy from HP to Linux

tar is probably a good idea as Patrick notes:

There are a few gotchas.

tar actually does not build the user name into the permissions of the tarball. It builds the unix numeric id in.

So if user schmo is user 212 on Linux and user bagel is user 212 on HP-UX then all those nice files will end up being owned by user bagel after the transfer.

The way around this when possible is to make sure the numeric user numbers in /etc/passwd are the same on both machines.

Also, Linux has openssh on it. This enables you to set up password free file copying to a HP-UX system.

The caveat there is I'm personally not sure if openssh/secure shell was ever ported for HP-UX 10.20, which is nearly a year past its support drop dead date.

If however you deal with the user number issues and find secure shell/openssh for HP-UX 10.20(I believe there still is a 10.20 version on http://www.openssh.org) you might find this to be a very smooth solution.

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
Mel Burslan
Honored Contributor

Re: FTP/Copy from HP to Linux

assuming you have root access to both hp/ux and linux boxes

on linux box, edit .rhosts in root's home directory and put line:

hpux_system_name root

at the end of the file. If file does not exist, just create it with 400 permissions

login to hpux box as root

cd /directory_to_copy
find . -depth -hidden | cpio -ocx | remsh linux_box_name "(cd target_dir ; cpio -idcumvx)"

make sure you already have the target_dir on linux box. whatever else will be created under it but this level must exist pre-copying.

HTH
________________________________
UNIX because I majored in cryptology...
Dani Seely
Valued Contributor

Re: FTP/Copy from HP to Linux

Hey Stuart,
If either system is NFS mounted you could just use "cp -p", otherwise, I suggest you use tar to create the backup on HP, compress it, then ftp it over to Linux.
Together We Stand!
Tonya Underwood
Regular Advisor

Re: FTP/Copy from HP to Linux

From the HP Server:

cd
rcp -pr * :

Thanks,
Tonya Underwood