- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script question
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
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
04-08-2004 05:26 AM
04-08-2004 05:26 AM
Script question
# begin script
PATH=/sbin:/usr/sbin:/usr/bin:/opt/omni/lbin:/opt/omni/bin
export PATH
if [ $SMEXIT != 0 ]
then
/opt/omni/lbin/backuperr
exit 0
else
echo "Successful Backup"
echo "Now submitting Daily_PROD_2_ULT backup run."
omnib -datalist Daily_PROD_2_ULT -no_monitor
touch /tmp/daily_prod_2_ult
echo `date` >> /tmp/daily_prod_2_ult
fi
echo "${progname} completed!"
exit 0
Would like to have the omnidb process complete before the file is touched, in effect have the script suspend until the Omniback backup is complete, once the backup is complete then have the file created. THankyou in advance for input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 06:03 AM
04-08-2004 06:03 AM
Re: Script question
you should use wait to be sure omnib is finished.
Try to look how this can be merged in your script (might be better with awk, but...)
#!/bin/sh
nohup sleep 5 >/dev/null 2>&1 &
SleepPID=`ps -edf | grep "sleep 5" | \
grep -v grep | tr "[:blank:]" " " | \
sed "s/ */ /" | cut -d " " -f 3`
wait $SleepPID
echo I waited for sleep to finish
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 06:08 AM
04-08-2004 06:08 AM
Re: Script question
# begin script
PATH=/sbin:/usr/sbin:/usr/bin:/opt/omni/lbin:/opt/omni/bin
export PATH
if [ $SMEXIT != 0 ]
then
/opt/omni/lbin/backuperr
exit 0
else
echo "Successful Backup"
echo "Now submitting Daily_PROD_2_ULT backup run."
omnib -datalist Daily_PROD_2_ULT -no_monitor
wait
touch /tmp/daily_prod_2_ult
echo `date` >> /tmp/daily_prod_2_ult
fi
echo "${progname} completed!"
exit 0
I am not sure if this will work - but try it out.
Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 06:15 AM
04-08-2004 06:15 AM
Re: Script question
You can remove the no_moitor option and check for RC and if you get a RC=0 then touch the file, else exit.
omnib -datalist Daily_PROD_2_ULT
if [ $rc = 0 ]
then
touch /tmp/daily_prod_2_ult
else
fi
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:11 AM
04-08-2004 07:11 AM
Re: Script question
The correct solution is to run
touch /tmp/daily_prod_2_ult
as a post_exec script in the
Daily_PROD_2_ULT
datalist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:27 AM
04-08-2004 07:27 AM
Re: Script question
else
echo "Successful Backup"
echo "Now submitting Daily_PROD_2_ULT backup run."
omnib -datalist Daily_PROD_2_ULT -no_monitor
touch /tmp/daily_prod_2_ult
echo `date` >> /tmp/daily_prod_2_ult
fi
TO
else
echo "Successful Backup"
echo "Now submitting Daily_PROD_2_ULT backup run."
omnib -datalist Daily_PROD_2_ULT -no_monitor && touch /tmp/daily_prod_2_ult
echo `date` >> /tmp/daily_prod_2_ult
fi
(See the use of &&)
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:36 AM
04-08-2004 07:36 AM
Re: Script question
I noticed that your script is a post_exec script (the SMEXIT variable) and you want to start a another backup from that script (consecutive backup).
You could use a post_exec script for the second backup which do the:
if [ $SMEXIT = 0 ]
then
touch /tmp/daily_prod_2_ult
echo `date` >> /tmp/daily_prod_2_ult
echo "${progname} completed!"
else
........
fi
Or you can use the same post_exec script for both jobs and use the variable
DATALIST
to chech which of the two jobs is runnnin and what should be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 07:38 AM
04-08-2004 07:38 AM
Re: Script question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2004 11:15 AM
04-08-2004 11:15 AM
Re: Script question
If the previous task is backgrounding off however, then it won't be much help, as the return is still immediate.