Operating System - HP-UX
1824174 Members
2237 Online
109669 Solutions
New Discussion юеВ

How to copy the data from one hpux server to another hpux server

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to copy the data from one hpux server to another hpux server

Hi All,

I want to copy the data from one hpux server to another hpux server.

We are running rlogin in destination, so how to copy the data using rlogin.

I don't want to over write the data in destination.
25 REPLIES 25
Steven Schweda
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

> [...] how to copy the data using rlogin.

How about remsh instead of rlogin?

A Forum search for keywords like, say,
tar pipeline
should find many examples. Adding "remsh"
should find some examples where two systems
are involved.

> I don't want to over write the data in
> destination.

I'd need more information about what you
intend to copy, and what might be
overwritten, before I'd want to discuss any
possibilities.
Pete Randall
Outstanding Contributor

Re: How to copy the data from one hpux server to another hpux server

Or you could use rcopy. The question is what kind of access you're going to have to the data. NFS? CIFS?


Pete

Pete
Pete Randall
Outstanding Contributor

Re: How to copy the data from one hpux server to another hpux server

You can also mount the other system's file system on the destination system:

mount sysA:/tmp /tmp/sysAtmp

Then cp what you need.


Pete

Pete
smatador
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

Hi,
If you have an very old box, you could also use rexec or ftp with .netrc not very secure but it could do the job.
http://docs.hp.com/en/B2355-90110/ch02s10.html
You could also of course use rcp/remsh and more secure if you could install ssh (scp/sftp)
One more, rsync .
HTH
Dennis Handly
Acclaimed Contributor

Re: How to copy the data from one hpux server to another hpux server

>how to copy the data using rlogin.

You can use rcp to copy the data, even without rlogin. As to overwriting the file, you would have to make it read only or check first.
Ernesto Cappello
Trusted Contributor
Solution

Re: How to copy the data from one hpux server to another hpux server

Hi Senthil, you can use rcp for example:

from source_server
rcp -r /tmp/file.tar root@destination_server:/opt/file.tar

where "/tmp/file.tar" is the file inside the source server and "/opt/file.tar" is the file inside the destination server.

BR.
Ernesto
Jupinder Bedi
Respected Contributor

Re: How to copy the data from one hpux server to another hpux server

use rcp command

rcp -rp source:/path destination:/path

and also you can use scp . the syntax is same

but in both the case your data will be overwrite.

if your data is very large than use tar command
All things excellent are as difficult as they are rare
Rita C Workman
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

On the remote server make a new directory called anything else. Make sure you have enough space on the mountpoint and/or directory to hold all this data.

rlogin
mkdir /some-mountpoint/MyFileFromOtherServer
exit

Now go back to the primary server and just do as folks above said...

rcp -R /dirpath/data* :/some-mountpoint/MyFileFromOtherServer

Now your data is all over there and didn't overwrite anything, cause it's under a different file system.

You could just as easily tar'd up the data on the primary and untar'd it on the remote to the new location too. Or you could put the data out to tape and then restore the data to the remote sever at a new location.
...so many options to pick from...

Rgrds,
Rita
senthil_kumar_1
Super Advisor

Re: How to copy the data from one hpux server to another hpux server

Is rlogin needs to be enabled to work with rcp?
senthil_kumar_1
Super Advisor

Re: How to copy the data from one hpux server to another hpux server

Does rlogin need to be enabled to work with rcp?
Suraj K Sankari
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

Yes
Suraj K Sankari
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

Hi,
You need to edit /etc/inetd.conf file

login stream tcp nowait root /usr/lbin/rlogind rlogind

this line should be uncommeted.

Suraj
James R. Ferguson
Acclaimed Contributor

Re: How to copy the data from one hpux server to another hpux server

Hi:

And, to add, to use 'rcp' you need to enable the 'remshd' daemon in '/etc/inetd.conf':

shell stream tcp nowait root /usr/lbin/remshd remshd

We should add that using the older 'r-commands' isn't very secure. You should use the Secure Shell counterparts ('ssh' and 'scp').

Regards!

...JRF...
senthil_kumar_1
Super Advisor

Re: How to copy the data from one hpux server to another hpux server

When I copy the data using rcp from one server to another by root user.

It copies all the data in the name of root in destination.

But I need to copy the data with user id and group id as it is in source server.

For that what is the syntax we have to use with rcp.





James R. Ferguson
Acclaimed Contributor

Re: How to copy the data from one hpux server to another hpux server

Hi:

> But I need to copy the data with user id and group id as it is in source server.

Create a 'tar' archive and copy that (with 'rcp' or 'scp') to your destination server. Then, un-tar the archive. This is an easy way to preserve all permissions, ownership and modification times of your files.

Regards!

...JRF...
Jupinder Bedi
Respected Contributor

Re: How to copy the data from one hpux server to another hpux server

rcp -rp source:/path username@destination:/path


Good Luck
All things excellent are as difficult as they are rare
Jupinder Bedi
Respected Contributor

Re: How to copy the data from one hpux server to another hpux server

and also suppose you are copying oracle data than make the entry in the .rhosts file of the destination server for the user oracle . if you will not do than you need to change the ownership by using chown command
All things excellent are as difficult as they are rare
Steven E. Protter
Exalted Contributor

Re: How to copy the data from one hpux server to another hpux server

Shalom senthil,

rcp syntax is the same as scp.

Man page pretty much covers that.

To avoid overwrite, you will need to write a script to insure that. rcp/scp will overwrite its not smart enough to figure out if the file is already there.

You could use rsync. It has options to prevent overwrite.

>>
For that what is the syntax we have to use with rcp.

<<

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
Steven Schweda
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

> [...] rsync. It has options to prevent
> overwrite.

GNU "tar", too:

"Options Controlling the Overwriting of
Existing Files"

http://www.gnu.org/software/tar/manual/html_section/extract-options.html#SEC69

As usual, many things are possible.
senthil_kumar_1
Super Advisor

Re: How to copy the data from one hpux server to another hpux server

Hi James,

When doing untar, it is over writing the files available in destination.


When we use the options "--keep-old-files" with tar, it is just checking parent directory and skips that directory if it is avilable in destination.

But I would want tar to check the sub-directories and fiels.

Is it possible.
Steven E. Protter
Exalted Contributor

Re: How to copy the data from one hpux server to another hpux server

Shalom,

tar man page answers this:

w Cause tar to print the action being taken, followed by the name of the file, then wait for the user's confirmation. If the user answers y, the action is performed. Any other input means "no".

In a test environment try the w parameter.

What should happen is overwrite warnings should display and the input to the yes/no prompt should be no.

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
senthil_kumar_1
Super Advisor

Re: How to copy the data from one hpux server to another hpux server

-w switch is not working.

I have checked that.
Steven Schweda
Honored Contributor

Re: How to copy the data from one hpux server to another hpux server

> When we use the options "--keep-old-files"
> with tar, it is just checking parent
> directory and skips that directory if it is
> avilable in destination.

Evidence? (Actual commands? Actual output?
Please don't tell me what you think is
happening. _Show_ me what you did, and what
happened when you did it. Then we _both_
can try to decide what is happening.)

It seems to work as expected for me:

dyi # gtar cfv gtt.tar itrc
itrc/
itrc/makefile
itrc/makefile2
itrc/cst.c
itrc/cst

dyi # mkdir itrc2
dyi # cd itrc2

dyi # gtar -x -v --keep-old-files -f ../gtt.tar
itrc/
itrc/makefile
itrc/makefile2
itrc/cst.c
itrc/cst

dyi # rm itrc/cst.c itrc/makefile2
dyi # gtar -x -v --keep-old-files -f ../gtt.tar
itrc/
itrc/makefile
gtar: itrc/makefile: Cannot open: File exists
itrc/makefile2
itrc/cst.c
itrc/cst
gtar: itrc/cst: Cannot open: File exists
gtar: Exiting with failure status due to previous errors

dyi # ls -lR
total 0
drwxr-xr-x 2 root sys 96 Feb 11 01:57 itrc

./itrc:
total 192
-rwxr-xr-x 1 root sys 70220 Nov 1 2008 cst
-rw-r--r-- 1 root sys 142 Nov 1 2008 cst.c
-rw-r--r-- 1 root sys 68 Oct 28 2008 makefile
-rw-r--r-- 1 root sys 106 Oct 28 2008 makefile2


For the record:

dyi # uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license

dyi # gtar --version
tar (GNU tar) 1.22
[...]

You're allowed to provide more details than
"hpux server", too.
Steven E. Protter
Exalted Contributor

Re: How to copy the data from one hpux server to another hpux server

Shalom again,

More details as noted in the prior host would be very useful.

Note that gtar is going to behave differently than tar. gtar is going to behave more like Linux tar and that might let you use the options you are trying to use.

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