- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Auto day-end script problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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-20-2003 11:14 PM
08-20-2003 11:14 PM
I am working on the auto day-end process which will send email to system administrator if any backup problem. However my script doesn't work, how do I improve the script? Also, the backup_db_test.log has nothing inside, why is that?
Thanks !
Regards
Ajk
################################
# Perform Backup
################################
DATE=`date "+%b %d"`
ADMIN_EMAIL=administrator@abc.com
echo
echo "Backup directories: /dskdump/livedbbackup"
echo "----------------------------------------"
echo "Insert a new tape into tape driver"
echo
echo "Press ENTER to start backup"
read dummy
cd /dskdump/livedbbackup
$ISD_MENU/writelog.sh Backup Disk Dump DB Start
tar cvhf /dev/rmt/0m * >> $ISD_MENU/backup_db_test.log
if [`grep -i "cannot open" $ISD_MENU/isdadmin.log|wc -l` > 0]
then
grep "$DATE" $ISD_MENU/isdadmin.log|grep "cannot open"|mailx -s "Backup tape cannot open" $ADMIN_EMAIL
fi
$ISD_MENU/writelog.sh Backup Disk Dump DB End
date
echo "Backup Finished !"
echo Press ENTER to continue...
read dummy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2003 11:16 PM
08-20-2003 11:16 PM
Re: Auto day-end script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2003 11:46 PM
08-20-2003 11:46 PM
Solution1) Nothing in the backup_db_test.loog because you never defined in this script the variable ISD_MENU. Also, quote it with graphes.
$ISD_MENU/backup_db_test.log -->> ${ISD_MENU}/backup_db_test.log
So do for all variables used in the script, it's best.
2) examinate the return code from tar:
tar .....
RC=$?
0 -->> all is OK
>0 -->> some errors, check
3) you could think of using fbackup/frecover, it's faster and with better output. refer to man pages for use and to this forum for a list of config parameters...
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2003 06:29 PM
08-21-2003 06:29 PM
Re: Auto day-end script problem
I modify my script, but it is still not working and the log file has nothing inside. Please help. Thanks a lot!
Regards
Ajk
################################
# Perform Backup
################################
#/misadmin/isd_menu/baktp_time.sh
DATE=`date "+%b %d"`
ADMIN_EMAIL=administrator@abc.com
echo
echo "Backup directories: /dskdump/livedbbackup"
echo "----------------------------------------"
echo "Insert a new tape into tape driver"
echo
echo "Press ENTER to start backup"
read dummy
cd /dskdump/livedbbackup
/misadmin/isd_menu/writelog.sh Backup Disk Dump DB Start
tar cvhf /dev/rmt/0m * >> /misadmin/isd_menu/backup_db_test.log
RC=$?
if [RC > 0]
then
mailx -s "Backup Error!" $ADMIN_EMAIL
fi
#if [`grep -i "cannot open" $ISD_MENU/isdadmin.log|wc -l` > 0]
#then
#grep "$DATE" $ISD_MENU/isdadmin.log|grep "cannot open"|mailx -s "Backup tape cannot open" $ADMIN_EMAIL
#fi
/misadmin/isd_menu/writelog.sh Backup Disk Dump DB End
date
echo "Backup Finished !"
echo Press ENTER to continue...
read dummy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2003 07:27 PM
08-21-2003 07:27 PM
Re: Auto day-end script problem
How are you launching this script? It seems familiar. Is it by cron? What's the cron entry?
Has it ever worked?
Did you know that for cron launched scripts you need to build the environment for it, its not like a telnet or secure shell login session?
What if any errors is this script generating.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2003 12:33 AM
08-22-2003 12:33 AM
Re: Auto day-end script problem
for debugging purpose, as the second line put a
"set -x"
so all commands will be printed.
Also: can you check with "ll" if the file and directory have proper permission for the user starting the commands ?
Maybe the file is empty because it is not writeable by the user.
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2003 02:58 AM
08-22-2003 02:58 AM
Re: Auto day-end script problem
[ blah blah > 0 ]
This, should be [ blag blah -gt 0 ]