tar extract to new path


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tar extract to new path
# 1  
Old 02-12-2009
tar extract to new path

I need to extract a file,which contains the path to a new path.
sample tar file
tar -tfv class.tar | grep client
-rw------- 0/1 99 Jan 22 12:46 2004 /usr/openv/netbackup/db/class/mariner/clients
-rw------- 0/1 102 Sep 25 11:33 2007 /usr/openv/netbackup/db/class/my-prmtrc01/clients
-rw------- 0/1 101 Oct 30 13:35 2003 /usr/openv/netbackup/db/class/pmdus2/clients
# 2  
Old 02-12-2009
tar extract to new path 2

found a way to extract a tar ball which contains full path names to files by using pax
i.e.
tar -tfv class.tar
-rw------- 0/1 50 Jan 21 16:01 2004 /usr/openv/netbackup/db/class/wdl-cti/schedule/Monthly/days
-rw------- 0/1 313 Jan 21 16:01 2004 /usr/openv/netbackup/db/class/wdl-cti/schedule/Monthly/info
drw-r-xr-x 0/1 0 Jan 21 16:01 2004 /usr/openv/netbackup/db/class/wdl-cti/schedule/DAILY/


pax -r -f class.tar -s'/usr\/openv\/netbackup\/db\/class\//tmp\/temp\//p'
/usr/openv/netbackup/db/class/wdl-cti/schedule/Monthly/days >> /tmp/temp/wdl-cti/schedule/Monthly/days
/usr/openv/netbackup/db/class/wdl-cti/schedule/Monthly/info >> /tmp/temp/wdl-cti/schedule/Monthly/info
/usr/openv/netbackup/db/class/wdl-cti/schedule/DAILY/ >> /tmp/temp/wdl-cti/schedule/DAILY/


I am not at all familiar with pax. Can anyone provide the syntax to extract just one file and change the path too?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tar command to take absolute path

Hi All, I am trying to create a tar from absolute path then transfer that file to another machine. But tar is not taking the absolute (full) path. Could you please help. I tried tar -cvf option at source and tar -xvf option at destination My variable has 3 files with full path... (2 Replies)
Discussion started by: sdosanjh
2 Replies

2. Shell Programming and Scripting

Incremental Backup using tar for more than one path

Hi everyone; I need to create a shell script for full and incremental backup purposes. for incremental backup only for one folder (test1) located in /home/test1 syntax below works fine and have no problem: tar -cvf /home/backup/backup-0.tar.gz -g /home/test1/test.snar /home/test Problem is here... (5 Replies)
Discussion started by: momed131
5 Replies

3. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

4. UNIX for Dummies Questions & Answers

How to Exclude the Path in TAR ?

Hi Is there any way to exclude the absolute path while using Tar , like am using the command # tar cvf mytar.tar /home/rakesh/myback/ when i extract the mytar.tar then it shows as /home /rakesh ... (1 Reply)
Discussion started by: rakeshkumar
1 Replies

5. Shell Programming and Scripting

How to extract strings from full path when full path is not fixed

/Path/snowbird9/nrfCompMgrRave1230100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird6/nrfCompMgrRave1220100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird14/nrfCompMgrRave920100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.... (0 Replies)
Discussion started by: Shirisha
0 Replies

6. Shell Programming and Scripting

one liner to extract path from PATH variable

Hi, Could anyone help me in writing a single line code by either using (sed, awk, perl or whatever) to extract a specific path from the PATH environment variable? for eg: suppose the PATH is being set as follows PATH=/usr/bin/:/usr/local/bin:/bin:/usr/sbin:/usr/bin/java:/usr/bin/perl3.4 ... (2 Replies)
Discussion started by: royalibrahim
2 Replies

7. Shell Programming and Scripting

Extract path within path

Hi, I have a environmental variables, ORACLE_HOME=/u01/oracle/ORCL/db/tech/10.2.0 ORACLE_SID=ORCL Now I need to create a variable and need to extract some part from ORACLE_HOME. I need to get the path from ORACLE_HOME till ORACLE_SID as /u01/oracle/ORCL. I may need to check also... (6 Replies)
Discussion started by: sreejitnair123
6 Replies

8. Linux

extract glibc-2.3.2.tar.tar

Hi, how can I extract glibc-2.3.2.tar.tar file ? I used tar -xf but does not work. Thank you. (4 Replies)
Discussion started by: big123456
4 Replies

9. Shell Programming and Scripting

extract one file form .tar.gz without uncompressing .tar.gz file

hi all, kindly help me how to extract one file form .tar.gz without uncompressing .tar.gz file. thanks in advance bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

10. UNIX for Dummies Questions & Answers

TAR : option to exclude absolute path

Dear All , :D I have a question ... I need to exclude the absolute path in the TAR process. For example : system("tar cvf /root/BACKUPS_$fecha.tar /root/BKP/"); system("gzip /root/BACKUPS_$fecha.tar"); I need to exclude de path " /root/BKP/ " in the file.tar.gz What is the parameter to... (1 Reply)
Discussion started by: telco
1 Replies
Login or Register to Ask a Question