- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Ignite backup script enhancement !!!
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2010 05:29 AM
08-22-2010 05:29 AM
Required your assistance in script enhancement, we have more then 350+ HP servers and we manage the backup from ignite server. we have configured in each server in cron job after successfull backup or failure . mail should be sent to sysadmin group but as per our new requirement only failure of backups should be mailed to admin group...
Can any one suggest a smart script.
Thanks
Ali
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2010 05:45 AM
08-22-2010 05:45 AM
SolutionYou can enhance the script with the failure condition , by checking the file/var/opt/ignite/recovery/latest/recovery.log
- Here is a sample given below:
#Executing Backup Script:
###########################################################
EMAIL=youremail@domain.com
DRIVE=/dev/rmt/0mn
echo "------ Starting Time:`date` ------" >> ${LOGFILE} 2>&1
echo " "
echo "Ignite (tape) Backup STARTED: `hostname` : `date`" | mailx -s "Ignite Backup STARTED: `hostname` : `date`" $EMAIL
/opt/ignite/bin/make_tape_recovery -x inc_entire=vg00 -I -v -a ${DRIVE} >>${LOGFILE} 2>&1
### Success_failure_check & Email:
tail ${LOGFILE} | grep -i unsuccess>/dev/null
if [ $? -eq 0 ]
then
echo " "| mailx -s "`hostname` :Ignite Backup FAILED!!! Please check!! " $EMAIL < ${LOGFILE}
else
echo " "| mailx -s "`hostname` :Ignite Backup Completed Successfully * * " $EMAIL < ${LOGFILE}
########
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2010 03:51 PM
08-22-2010 03:51 PM
Re: Ignite backup script enhancement !!!
We do it this way...
/opt/ignite/bin/make_net_recovery -s ${ignitehost} -P s -A -x inc_entire=vg00 ${exclude} > ${logfile} 2>&1
res=$?
case ${res} in
0 ) echo "Success: Ignite Backup for ${thishost} completed"
;;
1 ) echo "Failed! Ignite Backup for ${thishost} reported an error"
/usr/bin/tail -20 ${logfile} | /usr/bin/mailx -s "Ignite Backup FAILED - ${thishost}" root sysadm@my.domain.com >/dev/null 2>&1
;;
* ) echo "Comment! Ignite Backup for ${thishost} reported a warning"
;;
esac
Because we run all our Ignite jobs via the cron, we get an email automatically from the cron reporting success/warning/failure we also get a copy of the tail-end of any failing Ignite log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2010 05:03 AM
08-23-2010 05:03 AM
Re: Ignite backup script enhancement !!!
If i Want only failed backups to be mailed to our mail account, Then i will be using below steps....pls confirm
tail ${LOGFILE} | grep -i unsuccess>/dev/null
if [ $? -eq 0 ]
then
echo " "| mailx -s "`hostname` :Ignite Backup FAILED!!! Please check!! " $EMAIL < ${LOGFILE}
fi
I dont want successful backup mail...
Regards
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2010 06:50 AM
08-23-2010 06:50 AM
Re: Ignite backup script enhancement !!!
> I dont want successful backup mail...
Using Jim Walls' code (which leverages the return codes from 'make_tape_recovery', comment out (with a "#") the 'echo' statement for the case where the return code is zero. Otherwise, replace it with an 'exit' if appropriate.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2010 09:57 PM
08-23-2010 09:57 PM
Re: Ignite backup script enhancement !!!
Thanks......... full marks to all of them.. :)
Regards
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2010 09:59 PM
08-23-2010 09:59 PM