- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Seeking crontab solution
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
тАО04-02-2004 02:50 AM
тАО04-02-2004 02:50 AM
Thanks in advance for any assistance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 02:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 03:01 AM
тАО04-02-2004 03:01 AM
Re: Seeking crontab solution
I believe cron would be too convoluted a way to do it, since it could be any Sunday and any Wednesday from month to month.
Just modify your scripts to check a 14 day interval then check the day of the week to be sure it is the correct day.
Or you can hardcode it to check the Julian date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 03:02 AM
тАО04-02-2004 03:02 AM
Re: Seeking crontab solution
http://www.cmve.net/~merijn/#Contrib
Though the link seems to be down at the moment...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 03:04 AM
тАО04-02-2004 03:04 AM
Re: Seeking crontab solution
Link to Clays script:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=371092
HTH,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 03:05 AM
тАО04-02-2004 03:05 AM
Re: Seeking crontab solution
The key to this is caljd.sh; with no arguments it will return the current Julian Day (number of days since 4712 BCE). You divide that by 7 to get the week and then a mod 2 will yield 1 or 0 to get you every other week.
In your cron'ed script or cron'ed wrapper script do this:
payroll_wk()
{
typeset -i10 WK=$((($(caljd.sh) + 1) / 7))
typeset -i10 WK2=$((${WK} % 2))
return ${WK2}
} # payroll_wk
typeset -i10 THIS_WK=$(payroll_wk)
if [[ ${THIS_WK} -eq 0 ]]
then
echo "Do it"
else
echo "Don't; exit"
fi
You may need to change the logic so that if 1 you do it and also note that $(caljd.sh) + 1 is used so that the new week starts on Sun. Becuase of this, your "Sunday" logic will probably be different from your "Wednesday" logic.
Invoke as caljd.sh -u for full usage and examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 03:05 AM
тАО04-02-2004 03:05 AM
Re: Seeking crontab solution
Set in cron an entry to run every day at the correct start time.
In the script check if day of week is Sun or Wed and also check from a flag file if it is 14 days since last run time.
at the end of script if it is run then touch a flag file.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2004 03:47 AM
тАО04-02-2004 03:47 AM
Re: Seeking crontab solution
Thanks for your time. I appreciate it.