- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Check in script to make sure it only starts af...
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
Discussions
Discussions
Forums
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
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
тАО01-29-2012 04:09 PM
тАО01-29-2012 04:09 PM
Check in script to make sure it only starts after Midnight.
Hi there, we have a script which we need to run after midnight.
I need a check in the script to make sure it is starting up at midnight or a minute after as it invloves DB reorgs which must only be run after 12:00am.
I have done some testing but have only come up with some perl snippets.
the below code checks for the previuos day but i need it in korn
perl -MPOSIX=strftime -le 'print strftime "%m/%d/%Y",localtime(time-86400)'
Cheers Brad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2012 11:32 PM
тАО01-29-2012 11:32 PM
Re: Check in script to make sure it only starts after Midnight.
ACS's date hammer does that sort of operation in shell script:
http://www.cmve.net/~merijn/caljd-2.25.sh
Usage is included and pretty straightforward
Alternatively get GNU date from the GNU coreutils (and run-time dependencies) here:
http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.14/
with GNU date you can do plenty of simple date arithmetic like
date --d "-1 days"
I am an HPE Employee
- Tags:
- caljd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2012 12:05 AM
тАО01-30-2012 12:05 AM
Re: Check in script to make sure it only starts after Midnight.
Any reason you don't just schedule the script with crontab and don't put the check in the script?