Hi,
I'm trying to automate ontape and wrote a script to be executed in the crontab. But I am having an issue with my script. Since ontape when invoked it will ask for input like mounting a tape drive "Please mount tape 1 on /infxbu/backup.out and press Return to continue ..." I am sending a null/carriage return thru my script but for some reason is not working. I was wondering if anybody already have a script that I can take a look at or anybody can point out my mistake in the script. Thank you in advance for any help.
Here is the script
host=`hostname`
log=/usr/local/logs/infxontape.log
echo "Starting `hostname` ontape `date`" >> $log
echo "\n"|ontape -s -L 0 >> $log
if [ $? -ne 0 ]
then
echo "ERROR: $hosts did not complete its ontape backup!!!" >> $log
exit 1
else
echo "`hostname` ontape backup created successfully at `date`" >> $log
fi
I'm trying to automate ontape and wrote a script to be executed in the crontab. But I am having an issue with my script. Since ontape when invoked it will ask for input like mounting a tape drive "Please mount tape 1 on /infxbu/backup.out and press Return to continue ..." I am sending a null/carriage return thru my script but for some reason is not working. I was wondering if anybody already have a script that I can take a look at or anybody can point out my mistake in the script. Thank you in advance for any help.
Here is the script
host=`hostname`
log=/usr/local/logs/infxontape.log
echo "Starting `hostname` ontape `date`" >> $log
echo "\n"|ontape -s -L 0 >> $log
if [ $? -ne 0 ]
then
echo "ERROR: $hosts did not complete its ontape backup!!!" >> $log
exit 1
else
echo "`hostname` ontape backup created successfully at `date`" >> $log
fi