- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron Tab
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
06-21-2006 02:43 AM
06-21-2006 02:43 AM
Cron Tab
I want to execute one script on alternate mondays.
any idea how can i configure cron ?
thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2006 02:50 AM
06-21-2006 02:50 AM
Re: Cron Tab
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=113380
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2006 02:50 AM
06-21-2006 02:50 AM
Re: Cron Tab
In cron allow the script to run every Monday.
And in the script check if this is a say even Monday or a odd Monday using date +%V or %W whichever is suitable and allow the script to run if its the alternate Monday.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2006 02:56 AM
06-21-2006 02:56 AM
Re: Cron Tab
There is a script (cal_jd.sh) and perl version of same (cal_jd.pl) around here somewhere that may assist you in this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2006 02:56 AM
06-21-2006 02:56 AM
Re: Cron Tab
Install the attached utility, caljd.sh, in a directory (e.g. /usr/local/bin) and then your cron'ed script should look something like this:
#!/usr/bin/sh
typeset -i STAT=0
export PATH=${PATH}:/usr/bin:/usr/local/bin
typeset -i WK=$(( ($(caljd.sh) / 7) % 2 ))
if [[ ${WK} -eq 0 ]] # depending upon the week you want to start this might need to be -eq 1
then
echo "Do your thing"
fi
exit ${STAT}
This will work across year boundaries, leap years, whatever because caljd.sh in this form returns a sequential number of days since 1-Jan 4004 BCE. Invoke as caljd.sh -u for full usage and examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2006 03:02 AM
06-21-2006 03:02 AM
Re: Cron Tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2006 03:41 AM
06-21-2006 03:41 AM
Re: Cron Tab
typeset -i WK=$(( (($(caljd.sh) + 1) / 7) % 2 ))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2006 08:25 AM
06-26-2006 08:25 AM
Re: Cron Tab
Thanks for your valued reply,
sorry for delay in points!.