[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9493.0. "Vrestore 3.2g errors if script runs it interactivelyye" by RHETT::HEBERT () Mon Apr 14 1997 19:29

    Hello,
    
    I have a customer who has a script call vrestore interactively, and it
    works fine on dunix v3.2.  He upgraded to v3.2g, and now that script
    errors with "vrestore: Cannot use interactive shell in batch mode" in
    the logfile.  I searched through and didn't find any article discussing
    this.  Is there something different with the new vrestore that would
    affect a script running it?  This script is short and simple;
    _______________________________________________________________________
    
    #!/bin/ksh
    
    ###########################################################################
    #       Script Name:    cadcam00:/usr/local/koa/koa_backup.ksh           
    #
    #       Description:    Script executed via cron to perform daily
    backups #
    #                       of Komet's Op 96 CAD/CAM System.                 
    #
    #                                                                        
    #
    #       Written for:    Komet of America                                 
    #
    #       Written by:     y_sun                                            
    #
    #       Date written:   Dec 28, 1995                                     
    #
    #       Last edit:      Jan 06, 1995                                     
    #
    #       Called by:      /var/spool/cron/crontabs/root                    
    #
    #       Subroutines:    none                                             
    #
    #       Hardware:       Digital 2100 AlphaServer A500MP                  
    #
    ###########################################################################
    
    Tape_Dev=/dev/nrmt0h
    
    Bckp_Dsk[0]="/"
    Bckp_Dsk[1]="/usr"
    Bckp_Dsk[2]="/var"
    Bckp_Dsk[3]="/users"
    Bckp_Dsk[4]="/cadcam02"
    Bckp_Dsk[5]="/ug"
    
    Bckp_Drv="/users"
    Bckp_Usr="/users"
    Log_Dir="backup"
    Log_FDir="$Log_Dir/logfiles"
    Log_File="$Bckp_Drv/$Log_FDir/`date '+%m_%d_%y.log'`"
    Err_File="$Bckp_Drv/$Log_FDir/`date '+%m_%d_%y.err'`"
    Stp_File="$Log_FDir/`date '+%m_%d_%y.tmp'`"
    Date_Stp="$Bckp_Drv/$Stp_File"
    Unde_Dir="$Bckp_Drv/$Log_Dir/undelete"
    Rele_Dir="$Bckp_Drv/$Log_Dir/release"
    Koa_Rest="$Bckp_Drv/$Log_FDir/restore_instuctions"
    
    touch $Date_Stp
    Today=`date '+%a'`
    
    case $Today in
       Mon) Bckp_Dir="/users/backup/mon";;
       Tue) Bckp_Dir="/users/backup/tue";;
       Wed) Bckp_Dir="/users/backup/wed";;
       Thu) Bckp_Dir="/users/backup/thu";;
       Fri) Bckp_Dir="/users/backup/fri";;
       Sat) Bckp_Dir="/users/backup/sat";;
       Sun) Bckp_Dir="/users/backup/sun";;
    esac
    
    ##      Begin the daily CAD/CAM users' files backup             ##
    
    echo "\n        Starting the users' backup to disk on `date`" >
    $Log_File
    echo "-------------------------------------------" >> $Log_File
    find $Bckp_Dir -xdev -exec rm -f {} \;   >> $Log_File 2> $Err_File
    find $Bckp_Drv/$Log_FDir -mtime +7 -exec rm -f {} \; >> $Log_File 2>>
    $Err_File
    find $Unde_Dir -xdev -mtime +7 -exec rm -f {} \;    >> $Log_File 2>>
    $Err_File
    find $Rele_Dir -xdev -mtime +7 -exec rm -f {} \;    >> $Log_File 2>>
    $Err_File
    find $Bckp_Usr -xdev -type f -mtime -1 -print | grep -v
    "$Bckp_Drv/$Log_Dir/" >  /usr/tmp/
    new_file.lst
    cat /usr/tmp/new_file.lst                          >> $Log_File 2>>
    $Err_File
    file_list=`cat /usr/tmp/new_file.lst`
    for i_file in $file_list
    do
      cp -p $i_file $Bckp_Dir
    done
    mt -f $Tape_Dev rewind                             >> $Log_File 2>>
    $Err_File
    
    cat /etc/dumpdates                                 >> $Log_File 2>>
    $Err_File
    
    /sbin/vrestore -t                                  >> $Log_File 2>>
    $Err_File
    
    rm -f $Date_Stp
    cd ${Bckp_Dsk[3]}
    mt fsf 3                                           >> $Log_File 2>>
    $Err_File
      echo "add $Stp_File"                             >  $Koa_Rest
      echo "extract"                                   >> $Koa_Rest
      echo "1"                                         >> $Koa_Rest
      echo "yes"                                       >> $Koa_Rest
      echo "quit"                                      >> $Koa_Rest
    chmod 777 $Koa_Rest
    /sbin/vrestore -if $Tape_Dev < $Koa_Rest           >> $Log_File 2>>
    $Err_File
    rm -f $Koa_Rest
    
    if [ ! -f $Date_Stp ]
    then
      echo "The backup tape may not be reliable for restore" >> $Log_File
    else
      echo "Verified the backup tape, OK!"                  >> $Log_File
    fi
    rm -f $Date_Stp
    
    
    mt -f $Tape_Dev offline                            >> $Log_File 2>>
    $Err_File
    sleep 100
    
    echo "\n The CAD/CAM system backup to tape finished on `date` \n" >>
    $Log_File
    
    ##      mail the logfile and error file to the KoA CAD/CAM Coordinator 
    ##
    mailx y_sun < $Log_File
    mailx y_sun < $Err_File
    
    #       Shutdown and restart cadcam00 every Saturday morning after
    backup #
    if [ $Today = "Fri" ]
    then
      /sbin/shutdown -r now
    fi
    
    exit
    
    _______________________________________________________________________
    
    Any help would be greatly appreciated.
    
    Thanks,
    Armand Hebert
    CSC -Atlanta
                                                                     
T.RTitleUserPersonal
Name
DateLines
9493.1DECWET::MARTINTue Apr 15 1997 15:305
The probable cause of this (though I have no actual information to verify this)
is that the v3.2g vdump is NOT compatible with the v3.2g vrestore.  Get the v4.0
vrestore binary.

See DECWET::ADVFS_SUPPORT note 877.x for more detailed information.
9493.2vrestore:Cannot use interactive shell in batch modeRUSURE::KATZFri Apr 25 1997 18:0524
The error occurs because there is no tty associated to
the program, which would create a problem were we to need
to communicate with a user.
The code thinks you are running in batch mode (which you
are)
I believe the code was added as a bugfix (in other words
v3.2 was broken in that a job would run, but would have
to abort later if/when interaction was required). 
I recall discussing this with the maintainer and agreeing that
there is no way for the user to anticipate the program
queries and therefore interactive mode requires a live
program (not running out of batch).
I think it's likely that the file
    Koa_Rest="$Bckp_Drv/$Log_FDir/restore_instuctions"
would contain initial instructions for adding files to
the extraction list, and then performing the extraction,
BUT, it couldn't anticipate that vrestore had prompted 
the user as a result of an i/o error, to decide to abort
or continue. In light of this possibility it is wrong to
allow a user to proceed when they can get unexpected
results.

I believe that these sort of changes weren't documented 
in the v3.2c release (I think we started that in v4.0)