1831345 Members
3098 Online
110024 Solutions
New Discussion

tar

 
SOLVED
Go to solution
Michael_33
Regular Advisor

tar


Hi All,

There are 2 machines, on A server I have a directory /usr/a/b/c, there
are many exe files in it.

now I want to tar those files
into B server /opt, I know
rcp can do this, but failed.

Any idea?
5 REPLIES 5
S.K. Chan
Honored Contributor
Solution

Re: tar

To tar those files over, you can do this ..
On A
====
# cd /usr/a/b/c
# tar cvf /tmp/data.tar *
==> Create a tar ball (data.tar) and put it in /tmp. Make sure /tmp got enough space.
# cd /tmp
==> Now ftp the tar ball to server B and say you want to put it in /tmp in server B.

On B
====
1) # cd /opt
2) # mkdir dirA
3) # cd dirA
4) # tar xvf /tmp/data.tar
==> All the files under /usr/a/b/c from server A will be placed in /opt/dirA in server B.
==> If you don't want the "dirA" just ignore step 2 & 3

Hope this is what you want.
Vijeesh CTK
Trusted Contributor

Re: tar



hi,

on A

cd /opt/a/b/c
tar cvf /dev/rmt/0m *

On B

cd /opt
tar xvf /dev/rmt/0m

or u can make a tar archive file of all the files and ftp it to B and untar



Vijeesh CTK
S.K. Chan
Honored Contributor

Re: tar

If root can remsh from A to B, this is a more elegant way ..

On A
====
# cd /usr/a/b/c
# (find . -xdev|cpio -coax)|remsh B "cd /opt;cpio -icdmuxla"
Michael Tully
Honored Contributor

Re: tar

Hi,

Sometimes setting remote hosts can be a be
in the bonnet of security.... There are
occassions where a tape can be very useful.
You could also use another filesystem should have sufficient space. So instead of using a tape device you substitute a file name like /tmp/tar.out and then transfer the file using ftp.

On Server A
# cd /usr
# tar cvf /dev/rmt/0m ./a ./b ./c
or
# tar cvf /tmp/tar.out ./a ./b ./c

Move the tape to server B
# cd /opt
# tar xvf /dev/rmt/0m
or
# tar xvf /tmptar.out

There are 20 possible ways of doing this task, most of them involve setting up remote host access other than ftp.

HTH
-Michael
Anyone for a Mutiny ?
Michael_33
Regular Advisor

Re: tar

Thanks all! : )