Hi Friends,
I'm new to unix, I have the below script which takes regular backup. Now if fbackup fails I get the below messages in my log as
fbackup(3047): could not open output file /dev/rmt/0m
fbackup(3019): would you like to enter a new output file?
fbackup(3004): writer aborting
fbackup(1002): Backup did not complete : Reader or Writer process exit
Backup ENDED @ Thu Feb 19 17:02:47 CST 2009
Now alogwith these messages in the log, I also want a message to be thrown in the cosnole of the root user, incase the fbackup fails. Please help me to modify the script.
Its a bit urgent, please friends help.
#! /bin/ksh
myname=$(whoami)
if ([ $myname = root ])
then
echo 'BE SURE TO SHUTDOWN MONITROL APPLICATION'
# echo 'unmounting cdrom'
# echo 'Doing the backup'
echo 'Backup STARTED @ ' `date`
/bin/nice /etc/fbackup -f /dev/rmt/0m -i / -I /opt/monitrol/tmp/Index.full
echo 'Backup ENDED @ ' `date`
rcp -p -r /opt/monitrol/tmp/Index.full root@pmsmtv:/opt/Index.mix
# echo 'mounting cdrom'
# echo 'Done with the backup - '
else
echo '*** You MUST be ROOT to do a backup ***'
echo ' (because you need permission to read ALL files)'
echo ' '
echo ' '
fi
Thanks,
Avik.