Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help tar please

Status
Not open for further replies.

diabolo

Programmer
Joined
Jul 4, 2003
Messages
3
Location
FR

Hi, i ve to restore file from a DAT (the save command used : tar cvf /dev/rmt0 /dataPROD04/DATA/*)

On my tar i have (tar tvf /dev/rmt0 >> liste_cartouche.log):

...
-rw-r----- 300 12 2097156096 Jun 30 23:16:42 2003 /dataPROD04/DATA/temp01.dbf
...


i would like to restore this file in /dataINFO04/DATA/ and not in /dataPROD04/DATA/
'cause it's not on the same server. And it does not work !

i've tried :

tar xvf /dev/rmt0 /dataINFO04/DATA/temp01.dbf

or

cd /dataINFO04/DATA/
tar -xvf /dev/rmt0 dataINFO04/DATA/temp01.dbf
mv /dataINFO004/DATA/dataPROD04/DATA/temp01.dbf /dataINFO04/DATA/temp01.dbf

I'm on aix 4.3.2

Thanks
 
You've made the mistake most people make with tar initially(me too). Always only tar relative paths(dataPROD04/.......) not absolute paths (/dataPROD04/....). Note the differnce is the leading /. If you tar -cf /dev/rmt0 /dataPROD04/*, you can only untar it to /dataPROD04/*, BUT if you tar -cf /dev/rmt0 dataPROD04/*, you can cd /tmp and then tar -xf /dev/rmt0, which will then create /tmp/dataPROD04/*.

Next time:
cd /
tar -cvf /dev/rmt0 dataPROD04/DATA/*

Until then:
-make a backup of your current file
-untar the file you want over the current one
-copy it away somewhere
-restore/copy your current file back
 
Or take a look at the man page for pax? There have been quite a few threads about the use of pax - try a keyword search in the unix forums. Good luck.
 
Thanks for your reponses.
i 'll restore on another server (i can't untar on the current, the file is in use) i'll create a symbolic link for the untar. And i'll debug my script for the backup.

Thx.
(excuse my english)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top