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

Restore files with certain date.... 1

Status
Not open for further replies.

J304

Programmer
Jan 30, 2003
8
GB
Can anyone help?
I need to restore some files on a UNIX server using a backup tape but only the files with a certain time stamp. Can anyone give any ideas on how this may be done. I know you can restore files in a certain directory or with a certain name or the whole directory. But i only want files restored with a certain date (Time stamp).
Please help!!
 
This should be the tar routine via the system administration console!
 
There may be a better way but you could first get a list of the files that match the date by entering:
tar -tv | grep "Feb 11" > /tmp/filelist
Now edit or use the cut command to process the /tmp/filelist to leave just the file names. Then:
cd /yourdirectory
tar -xvF /tmp/namelist
The capital F option should only recover the names from the file
 
Sorry,
The F option would not be valid on tar extract (x). You would need to code it :
tar -xv `cat /tmp/namelist`
 
I have tried the suggested and i keep recieving directory checksum errors! I keep going through the instructions and keep trying but it does not work

This is becoming annopying can anyone help!!!!!
 
Is the first tar command failing or the last. if it is the 1st one, can you see the tape being accessed? If it is the last tar command can you post a few lines of the file created by the 1st tar command?
 
The first step of making a list of file using the tape keeps falling over with Tar=block2 directort checksum error.
The tapoe does not look like this is being accessed.

I just realised that maybe we have got confused. I accidently ran a program which wiped some of the date stamps of files on the server. I am trying to restore OVER the files with the date stamp of Jan 6. which was the date i ran the program. i have made a list of all the files on the server that were affect by my run using
lt | grep "Jan 6"> /tmp/filelist. i have tried using this list intsead of the tape list but still recieve directory checksome errors.

Help!!!
 
Hi,
If you tape does not look like it is being accessed, you may need to specify the tape drive device. If you do not know it, cat the /etc/default/tar and look for the device (such as /dev/rStp0).
tar -xvf /dev/rStp0 `cat /tmp/namelist` or
tar -xvbf /dev/rStp0 `cat /tmp/namelist`.
By the way, are you on SCO or some other O/S?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top