Re: Backup using 'ontape -a' fails within log_full.sh
Posted in 2003
Andrew Johnstone wrote:
> Hello,
> I have been trying to use log_full.sh to backup our logical logs to
> tape. I'm using IDS 9.3 on AIX.
>
> Oncofig has been altered to use the ALARM program log_full.sh, of
> which I have included the main parts below.
>
> #-------------------------------------------------------------#
> PROG=`basename $0`
> USER_LIST=informix
> BACKUP_CMD="ontape -a"
> EXIT_STATUS=0
>
> EVENT_SEVERITY=$1
> EVENT_CLASS=$2
> EVENT_MSG="$3"
> EVENT_ADD_TEXT="$4"
> EVENT_FILE="$5"
>
> case "$EVENT_CLASS" in
> 23)
> $BACKUP_CMD 2>&1 >> /export/home2/stu103/Llog
> EXIT_STATUS=$?
> ;;
> *)
> ;;
> esac
>
> exit $EXIT_STATUS
> #-------------------------------------------------------------#
>
>
> This appeared to be working fine, except when I checked the output
> of the
> BACKUP_CMD the following error was present:
>
> #-------------------------------------------------------------#
> Performing automatic backup of logical logs.
> Please mount tape 1 on /dev/rmt0 and press Return to continue ...
> Do you want to back up the current logical log? (y/n) Logbackup failed
> -
> Please label this tape as number 1 in the log tape sequence.
> This tape contains the following logical logs:
> 5 - 6
> Program over.
> #-------------------------------------------------------------#
>
>
> I assume this is failing becuse it is waiting for a response ? When
> I issue 'ontape -a' from the command line there are no errors
> returned. The original log_full.sh program sends the output of the
> command to /dev/null so I'm wondering whether these is in fact any
> errors at all ?
Yes, you can supply the correct responses using something like:
ontape -a <<-! >>/export/home2/stu103/Llog 2>&1
n
!
> Am I going about this the right way ? If not, I would appreciate
> some guidance on how I might make 'log_full.sh' work correctly.
See my response to Sadi G'rsoy.
I think what you are doing is VERY scary. For one, you have the
potential for trying to run multiple log backups simultaneously. For
two, the very next successful log backup will probably OVERWRITE the
previous log backup..., unless you are VERY quick (tape stacker?) at
removing that tape!
> Also, is there any way to check the tape to see if the backup has
> been successful or not ?
I would start with checking the status of ontape, but I don't know if it
reports success or failure correctly.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+