ITEM: E8429L

Problem with backup and restore using scripts/cron


Question:

AIX VERSION 3.2.4 using 8mm 2.3Gb Tape with block size set to 1024.

I have a script that I run to backup my files.  The files are backed up
to tape as three stacked backup images.  These scripts basically use the 
backup command with rmt0.1 specified so that the tape does not rewind. 
When I try to restore the first backup it gives me the second backup. 
The second backup restores fine. However, when I try to restore the 
third backup that is created by a separate cron job, I get an error 
message that indicates some kind of media error. I have cleaned the tape 
drive using cleaning tape and called a CE to run Diagnostics on the tape 
drive (that came out fine). I have even tried using different tapes, but 
I keep getting the same error messages. 

The backup commands that are being used are as follows:

/usr/bin/cat /mis/misbackup.list | \\
  eval /usr/sbin/backup -i -v -f/dev/rmt0.1 -q >> $DEFILE 2>&1

/usr/bin/find /usr/soback -print | \\  
  eval /usr/sbin/backup -i -v -f/dev/rmt0.1 -q >> $DEFILE 2>&1

/usr/bin/find ./usr/mas90 -print | 
  eval /usr/sbin/backup -i -v -f/dev/rmt0.1 -q >> $STFILE 2>&1

We are trying to read the table of contents of each of the images
with the following commands:

  tctl rewind
  restore -Tvf/dev/rmt0.1
  restore -Tvf/dev/rmt0.1
  restore -Tvf/dev/rmt0.1

Response:

You should use either one of the following procedures to list the table
of contents of each of the three images on the tape:

  tctl -f/dev/rmt0 rewind
  restbyname -Tv -f/dev/rmt0.1 
  restbyname -Tv -f/dev/rmt0.1
  restbyname -Tv -f/dev/rmt0.1

        --OR--

  tctl -f/dev/rmt0 rewind
  restore -Tvs1 -f/dev/rmt0.1
  restore -Tvs1 -f/dev/rmt0.1
  restore -Tvs1 -f/dev/rmt0.1

The reason you have to specify the -s flag with the restore command is 
because the restore command will open the device and check to see which 
type of backup was used to make the tape.  It then closes the device 
which will forward to the next image at this point because you specified 
the no rewind option.  So, when it opens the device again for reading
it is now positioned at the second backup image rather than the first.  
restbyname does not do the initial check for type of backup and that is 
why it works fine without the -s flag.

Note: You can also specify a different -s value if you are positioned 
at the first of the tape and you want to retrieve an image other than 
the first backup image.


Support Line: Problem with backup and restore using scripts/cron ITEM: E8429L
Dated: November 1993 Category: N/A
This HTML file was generated 99/06/24~13:30:53
Comments or suggestions? Contact us