Operating System - HP-UX
1834248 Members
2124 Online
110066 Solutions
New Discussion

Re: copy files from one system to another

 
SOLVED
Go to solution
Sanjiv Sharma_1
Honored Contributor

copy files from one system to another

Hi All,

I have a requirement to copy one 12 GB filesystem from one system to another.

System A HP-UX 11.00
Filesystem /abc/efg/ijk 12 GB

System B HP-UX 11.11
Filesystem /abc/efg/ijk

I want to create a single file of the files in the filesystem /abc/efg/ijk in system A which will also be compressed. ftp this file to System B and then uncompress and copy over the filesystem.

Thank you,
Sanjiv
Everything is possible
17 REPLIES 17
jpcast_real
Regular Advisor

Re: copy files from one system to another

Would not be easier to use nfs ..... exporting the filesystem and importing it in the other node???
Here rests one who was not what he wanted and didn't want what he was
Muthukumar_5
Honored Contributor

Re: copy files from one system to another

Simply use NFS exportfs and mount.

Start nfs.* services.

sysA
exportfs -iv /abc/efg/ijk

sysb
mkdir /abc/efg/ijk
mount -v systemA:/abc/efg/ijk /abc/efg/ijk

HTH.
Easy to suggest when don't know about the problem!
Sanjiv Sharma_1
Honored Contributor

Re: copy files from one system to another

Thanks for the reply but I am thinking of using cpio and gzip. Then ftp, gunzip and cpio.

Everything is possible
Sanjiv Sharma_1
Honored Contributor

Re: copy files from one system to another

looking for exact command and syntax.
Everything is possible
jpcast_real
Regular Advisor

Re: copy files from one system to another

My suggestion:

tar -cfv tmp.tar /tmp

gzip tmp.tar

Ftp the gzip file

in the remote system:

gzip -d tmp.tar.gz

tar -xvf tmp.tar

Here rests one who was not what he wanted and didn't want what he was
jasper_2
Occasional Advisor

Re: copy files from one system to another

Hi Sanjiv,

Here some other way to do it;

1. scp (using ssh copy) - using compression mode to make your copy faster

scp -Cr /abc/efg/ijk remoteaccount>>@:/abc/efg/ijk

here your are doing direct copy of your directory from SYMTEM A to your SYSTEM B directory

2. you can also do a gzip of your whole directory then ftp or scp or sftp it to SYSTEM B... then gunzip it to your directory

3. rcp (similar to scp if you dont use ssh)

4. using nfs ...as stated in previous threads

5. using tar then ftp to SYSTEM B then untar

all these you can also automate if you have several file systems to copy and do it simulteauosly

Hope these helps.

Jasper
the chose is yours, we are the product of the choices we make...
TwoProc
Honored Contributor

Re: copy files from one system to another

On source machine...
cd /sourcedir
tar cvf - . | compress | ssh destmachine " cd /targetdir | uncompress | tar xvf - "
*** You can use gzip where compress is***

If you don't want the compress commands..
tar cvf - . | ssh destmachine " cd /targetdir | tar xvf - "

Since you've got ssh setup... you can use rsync... it's slower (the first time) , but faster for resyncing (if that's a goal):

If on source machine...
rsync -avze ssh /sourcedir/ destmachine:/destdir/

If on destination machine...
rsync -avze ssh sourcemachine:/sourcedir/ /destdir/

Notes:
Search http://hpux.cs.utah.edu/ (The HPUX porting archive) to get rsync.
the "z" compresses the data on the fly
the "e" flag means external communication method (in this case ssh, as indicated)
the trailing "/" on the directory names *are important*.

We are the people our parents warned us about --Jimmy Buffett
Sanjiv Sharma_1
Honored Contributor

Re: copy files from one system to another

Thanks for all the replies and suggestions.

Can I include "gzip" in the following command so that the output file becomes "ijk.cpio.gz in System A?
# find /abc/efg/ijk â print | cpio â Bodcm >/tmp/ijk.cpio

In System B
I would like to include the gunzip in the following command "input file will be ijk.cpio.gz" :
# cpio â Bidcm
Everything is possible
harry d brown jr
Honored Contributor

Re: copy files from one system to another


Raje,

get GNU's tar, and use the built in gzip capabilities:
http://hpux.ee.ualberta.ca/hppd/hpux/Gnu/tar-1.15/

tar --gzip -cvf tarfilename.tgz [path]

then ftp it, then

tar --gunzip -xvf tarfilename.tgz

live free or die
harry d brown jr
Live Free or Die
Fred Ruffet
Honored Contributor

Re: copy files from one system to another

Mixing remsh and tar (or cpio), you can compress, transfer and uncompress at the same time. You may improve perfs with such a command :
tar -c /abc/efg/ijk | remsh sysB tar -x

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)

Re: copy files from one system to another

You may want to read theses notes i took about several data replications methods (tar,cpio, dumps,rsync,...) wiath pros/contras.

(It's in spanish, but i hope you could understand at least the commands, and most of the comments).

Hope it helps you,

Regards,
Alex
Sanjiv Sharma_1
Honored Contributor

Re: copy files from one system to another

Thank you all for your useful tips.

Can you help me to understand which command will give me the maximum compression?

gzip, compress, etc...or any other utility.

Can I further compress a file which is already compressed with "gzip" utility?
Everything is possible
Nguyen Anh Tien
Honored Contributor

Re: copy files from one system to another

file size 12GB is so big.it is easy to get network overload.
My solution:
1. If you have tape and tape driver. your should tar file to tape
at system A:
#tar -cvf /dev/rmt/0mn abc/efg/ijk
at system B:
#tar -xvf /abc/efg/ijk
2. If tape driver is not availble. you should use NFS.
at systemA:
- export this file
at system B:
- mount this file
that all
tienna
HP is simple
Thayanidhi
Honored Contributor

Re: copy files from one system to another

Hi,
Up to my knowledge tar can handle files only 8GB or below! May be there is new tar patch available now.
I think fbackup to tape, frecover to other system, would be suitable.

Regrds
TT
Attitude (not aptitude) determines altitude.
noldi
Valued Contributor

Re: copy files from one system to another

Hello Sanjiv,

check this thread (this is how I solved this
a while ago):

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=710793

This worked even with big files, without the
(nowadays silly) file size restrictions.

hth.

Regards,

Arnold
noldi
Valued Contributor

Re: copy files from one system to another

Sanjiv,

forgot that you were copying between different nodes.
So, if "remsh" is working in your configuration, it would look similar to
this:

src# cd /source
src# fbackup -f - -i . | remsh tgt 'cd /dest; frecover -rXf -'

where is your target node.

Best Regards,

Arnold
Fred Ruffet
Honored Contributor
Solution

Re: copy files from one system to another

About compression level...

3 programs I use are compress, gzip and bzip2. Compress is installed with OS. 2 others are available as depot.

From lowest compression to higher :
. compress
. gzip
. bzip2

Said that, you may ask why use others if bzip2 compresses the best ? Answer cause the better you compress, the most time it takes.

For backup purposes, I compress my database exports. For the same export file, compress outputs à 8+GB file, gzip a 5GB file and bzip2 a 2.5GB file. Compress gives its in 2 hours, whereas gzip takes 4 hours and half and bzip2 more than 5 hours (They run in parrallel with export process).

So you may have to found what is the best for you from tests. Note that, as you want simultaneous compress/uncompress, bzip2 uncompresses very fast.

Other point gzip and bzip2 have options to increase and decrease compression level (and so time).

Regards,

Fre
--

"Reality is just a point of view." (P. K. D.)