The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
untar & unzip brendan76 Linux 1 01-16-2008 03:50 AM
untar prakash96453 UNIX for Advanced & Expert Users 2 10-19-2007 01:59 AM
untar to a specified file melanie_pfefer UNIX for Dummies Questions & Answers 3 11-27-2006 02:32 PM
Untar to different location pradeep_desh UNIX for Advanced & Expert Users 1 05-26-2006 11:05 AM
how to untar *.dpk files gauri UNIX for Dummies Questions & Answers 3 03-06-2006 04:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-05-2006
rahul26 rahul26 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 15
Arrow Urgent....untar!!!

HI UNIX GURUS...
I am facing the a similar problem which malaymaru has posted earlier raegarding untaring a file in some other specified directory.But the solution by UNIX DAEMON "Perderabo" seems little difficult to understand.(USING #pax -r -s '=^/opt/abc=/tmp=' < tarfile)

So plz explain it.........i know this question has been posted earlier.But the number of replies is very less and little difficult to understand.So plz help.

The exact problem statement as follows:--

Suppose a directory is there in /abc/def/source_directory.
Now i make a tar of this directory as source_directory.tar and am successfully able to
ftp it to another server in the path ghi/jkl/source_directory.tar
Now how do i untar the source_directory.tar in the path ghi/jkl only.Now when i try to
untar it from my script using rexec command.the it is being untared to the HOME DIRECTORY
which i believe is happening due to conflict of path when untar is happening....
sample code i m using in my script to untar at the destination server once i m successfully able to ftp the filename.tar.gz file:
rexec azx.corp.asd.com gunzip $2/"$filename".tar.gz
rexec qwe.corp.fgt.com tar -xvf $2/"$filename".tar
plz post the exact solution...

Thanx,
rhaul26

Last edited by rahul26; 06-05-2006 at 08:41 AM..
  #2 (permalink)  
Old 06-06-2006
thestevew thestevew is offline
Registered User
  
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
I'm a bit confused by the two different machine names:
Quote:
rexec azx.corp.asd.com gunzip $2/"$filename".tar.gz
rexec qwe.corp.fgt.com tar -xvf $2/"$filename".tar
Can you clarify exactly what the full series of steps is.

cheers
  #3 (permalink)  
Old 06-08-2006
rahul26 rahul26 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 15
Unhappy

Actually the series of step is as follows:--

i)I m successfully able to ftp a .tar.gz file to a remote location.

ii)Question is how i untar it from script in host only.
I tried using rexec command.
rexec idm.adf.com(name of remote location) gunzip abc/def/something.tar.gz
So after this commad is executed,the .tar file is formed as abc/def/something.tar

But now when i try to unzip it there bu using
rexec idm.adf.com(name of remote location) tar -xvf abc/def/something.tar
The tar file is being formed at the home directory instead of the specifeid path.

Hope it helps.............Plz reply.........very few replies till date.......

Thanx
rahul26
  #4 (permalink)  
Old 06-08-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
since you have acces to both machines, why not do it the simplest way?

what creating the tar file, go to the directory you want to tar and make a relative path archinve, then when you untar it it will extract in the CWD.
  #5 (permalink)  
Old 06-12-2006
rahul26 rahul26 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 15
Hi...
But one if one wants to do the same for 40 Application servers.

regards,
Rahul
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0