Operating System - HP-UX
1752681 Members
5490 Online
108789 Solutions
New Discussion юеВ

Re: Commands to copy a file system across hosts

 
SOLVED
Go to solution
Mahesh_20
Advisor

Commands to copy a file system across hosts

Hello,

We are into a peculiar situation. Situation is as follows.

We have Building A with Machine A having a Tape library and say a file system /data1.

We have another building B; which is across the road to Building A in same campus. Building A and Building B are connected by LAN. There is no enterprise backup software like Dataprotector or any other third party software.

Building B hosts machine B without a tape drive and has /data1 file system.

Challenge is to copy /data1 of machine A to /data1 file system of machine B with a single command as far as possible and with retaining owner and group. (UID, GID will be taken care of.)

Can you post the commands here so that we can do the copy of file system across LAN? (There is no enough space to tar on machine A and then copy tar file to machine B and then untar. Preferably a single command using pipe.)

Please list out as many different ways as possible.

Reason for this is; on site we have SAP Basis administrator and does not have much OS knowledge at site.

Thanks and Best Regards.

Mahesh
8 REPLIES 8
vishnu.khandare
Respected Contributor
Solution

Re: Commands to copy a file system across hosts

Hi Mahesh,

U can copy the files acoross diffrent system, by scp.
syntam
scp -p sourece_file username@IP_address:/path_where to save/
It will ask for authentication
Provide to copy.

Hope this solves ur issue
Dont foget to assign points.

Regards
Vishnu Khandare
You should deserve before U desire!!!!
DeafFrog
Valued Contributor

Re: Commands to copy a file system across hosts

Hi Mahesh ,

How sync should the data be , would you use password less scp b/w machine , copy the files (vishnu's method) or you could use rsync ,

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1288852927917+28353475&threadId=1433453.
.


FrogIsDeaf
Mahesh_20
Advisor

Re: Commands to copy a file system across hosts

DealFrog,

The system appears to be non-reachable or is there any issue with the link?

Regards
Dennis Handly
Acclaimed Contributor

Re: Commands to copy a file system across hosts

>he system appears to be non-reachable or is there any issue with the link?

It worked for me. Try this cleaned up version:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1433453
Mahesh_20
Advisor

Re: Commands to copy a file system across hosts

Hi Denis,

What I am looking at - A single command which will copy entire file system from source of a machine to destination of another machine.

Rsync will involving installation of soem software; although can be easy - onsite SAP Basis resource wont be able to do.

Hence like scp command; if you have any other approaches; please let us know.

Thank you.

Best Regards

Mahesh
Ralph Grothe
Honored Contributor

Re: Commands to copy a file system across hosts

You can dump the whole filesystem by tunneling it through ssh.
Just use any dump/restore, fbackup/frecover (if source and target are HP-UX), tar, pax or find/cpio -o/cpio -i combination that you are familiar with or the respective OS provides.
You could even dump a raw copy stream by dd through the tunnel.
Examples of this must have been posted here hundreds of times.
Basically, it often looks similar to this

e.g.

# cd /mount/of/fs2dump && find . -xdev -depth -print0 | cpio -o0 | ssh remhost 'cd /mount/where/to/restore2 && cpio -id0

(n.b. this fits GNU find/cpio, on HP-UX ommit -print0 and the -0 options in cpio commands)
Madness, thy name is system administration
stephen peng
Valued Contributor

Re: Commands to copy a file system across hosts

how about on A:
tar cvf - /data1 | remsh B tar xvf -

regards
stephen
Hakki Aydin Ucar
Honored Contributor

Re: Commands to copy a file system across hosts

if you will not face with any security issue, you might also use/try;

# rcp file hostname:/path_to_copy_file