Urgent....untar!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Urgent....untar!!!
# 1  
Old 06-05-2006
CPU & Memory 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 Smilie

Last edited by rahul26; 06-05-2006 at 09:41 AM..
# 2  
Old 06-06-2006
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  
Old 06-08-2006
Data

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  
Old 06-08-2006
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  
Old 06-12-2006
Hi...
But one if one wants to do the same for 40 Application servers.

regards,
Rahul
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. UNIX for Dummies Questions & Answers

How to untar the below file?

I need to extract the below file. could you please let me know how to extract by using unix command. manfucture.today.1678.tar.gz (5 Replies)
Discussion started by: ramkumar15
5 Replies

3. Solaris

Unable to Untar

Hello, bash-2.05# tar -xvf sunos.tar tar: directory checksum error bash-2.05# file sunos.tar sunos.tar: data bash-2.05# Can someone please help me untar this. This is a Solaris 9 box. (5 Replies)
Discussion started by: zigi_p5
5 Replies

4. Shell Programming and Scripting

Not able to untar file

Hello Experts, I have requirement in which a file is present in the folder_test. In that folder there is file called Test.tar.gz.20111102. Now my requirement is i have to rename this file to someother format and untar it.... folder_test Test.tar.gz.20111102 I am using the below... (5 Replies)
Discussion started by: aks_1902
5 Replies

5. Shell Programming and Scripting

cp, chown, untar

hello i want shell script. i have a source.txt /home/user409/public_html/test/ /home/user09876/public_html/xdsss/ /home/user9765/public_html/320xxx/ . . . maybe 1000 lines i want . 1.read a source.txt 2.untar special.tar.gz into these directory in source.txt 3.i want to... (14 Replies)
Discussion started by: topic32428285
14 Replies

6. AIX

untar

Hi, How can i untar a set of files in to different directory. This is content tar -tvf samba.tar drwxrwxrwx 0 0 0 Nov 28 18:35:41 2008 samba/ -rw-r--r-- 0 0 0 Nov 18 15:12:40 2008 samba/b.txt -rw-r--r-- 0 0 0 Nov 18 15:12:40 2008 samba/c.txt -rw-r--r-- 0... (4 Replies)
Discussion started by: allwin
4 Replies

7. UNIX for Dummies Questions & Answers

Untar problems

Hi, I am new to unix scripting. I have written a java program which will initialize a sftp connection and copy a unix script from my machine to a remote server. Then i initalized an ssh connection and i executed the script. This script contains a sequnece of commands and one of them is to... (2 Replies)
Discussion started by: vinothg
2 Replies

8. UNIX for Advanced & Expert Users

untar

i have try to untar the file in same location. But it gave the error # tar -xvf TSMSRVAIX5220.tar x tivoli.tsm.devices.acsls, 757760 bytes, 1480 media blocks. tar: 0511-169 A directory checksum error on media; 4011 not equal to 8222. How can i rectify this prob. Thanks in advance ... (2 Replies)
Discussion started by: prakash96453
2 Replies

9. UNIX for Dummies Questions & Answers

untar to a specified file

I have file1.tar and want to untar it under /server/file2. If I do tar -xvf file1.tar, the files will be deployed under file1. How to specify the destination folder?? thx (3 Replies)
Discussion started by: melanie_pfefer
3 Replies
Login or Register to Ask a Question