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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desperate for help using tar to restore deleted files 1

Status
Not open for further replies.

dls

Technical User
Jul 18, 2000
1
0
0
US
HELP!!!<br>I accidently deleted some very important files.&nbsp;&nbsp;I know they are on the backup tape but I cann't figure out the syntax to get them back. <br><br>this is the script that creates the archive<br><br>:<br># 9/10/99 - abackup (temp)<br>cd /<br>/u/apps/qad/mfgpro/8.6e/stop.ALL 1&gt;/tmp/mfgpro.stop 2&gt;&gt;/tmp/mfgpro.stop<br>sleep 10<br>tar cv8 u u2 1&gt;/tmp/back.log 2&gt;&gt;/tmp/back.errs<br>sleep 10<br>/u/apps/qad/mfgpro/8.6e/start.ALL 1&gt;/tmp/mfgpro.start 2&gt;&gt;/tmp/mfgpro.start<br><br>I accidently deleted all the files in the /u/home/pam directory.&nbsp;&nbsp;I ran tar tv8 and verified that the files I need are on the tape.&nbsp;&nbsp;the file /tmp/back.log contains, in part the following:<br>.<br>.<br>a u/home/pam/.lastlogin 0 tape blocks<br>a u/home/pam/deprn00.xls 93 tape blocks<br>a u/home/pam/annxfr.xls 32 tape blocks<br>a u/home/pam/DEPRN.wk3 915 tape blocks<br>.<br>.<br>Is there anyone who can tell me what my pwd and what my tar command line should be to restore all the files I deleted?<br><br>I shall be eternally grateful.<br><br>dls<br><br><br>
 
if you can see the files with tar tv8 I would assume the you should be able to restore them with tar xv8 /u/home/pam.<br>Further assume that you need to be logged in as root as there are permissions potentially involved and at / to do it.&nbsp;&nbsp;&nbsp;But verify from / that u is one level down. <p>Ed Fair<br><a href=mailto: efair@atlnet.com> efair@atlnet.com</a><br><a href= > </a><br>Any advice I give is my best judgement based on my interpretation of the facts you supply. <br>
Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.<br>
 
To save some time after you have restored the files, you can ask tar to restore them using the original owner, group, and access permissions.&nbsp;&nbsp;Add the &quot;o&quot; and &quot;p&quot; options to the tar command given by Ed:<br><FONT FACE=monospace><br>cd /<br>tar xvop8 u/home/pam<br></font><br>(Note the lack of a leading slash.&nbsp;&nbsp;The original backup is created using relative paths - &quot;tar cv8 u u2 ...&quot; - so you need to specify the files to restore using relative paths.) <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top