- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How do I create a cron job?
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-11-2007 07:06 PM
06-11-2007 07:06 PM
If I want to automate the cron job to be run at 12 noon and 5 p.m, on 15th,27th, and 28th of every month, every month during week days.
Is it ok if I put like this?
00 12,17 15,27,28 * 1-5
Thanks a bundle. Hope to hear from you soon.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 07:14 PM
06-11-2007 07:14 PM
Re: How do I create a cron job?
From your words above, that sounds like you want inclusive OR?
If you want AND you'll need to put one of these checks into your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 07:33 PM
06-11-2007 07:33 PM
Re: How do I create a cron job?
Thanks for the reply
If I understand you correctly, basically
I would like the the monitoring to run (00 12,17) 12.00 noon and 17.00 p.m.(15,27,28 *) on 15th, 27th and 28th of every month (1-5) from monday to friday. Will it run what I want it to be?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 07:38 PM
06-11-2007 07:38 PM
Re: How do I create a cron job?
00 12,17 15,27,28 * 1-5 >>your cron activity.
This must work according to your requirement.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 07:41 PM
06-11-2007 07:41 PM
Re: How do I create a cron job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 07:43 PM
06-11-2007 07:43 PM
Re: How do I create a cron job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 07:49 PM
06-11-2007 07:49 PM
SolutionNow you want it to run on 15,27,28 only if it falls on Mon-Friday then in crontab you should have an entry like
00 12,17 15,27,28 * *
Then in the script it self you need to check either it is Mon-Friday or not?
I don't find anything to do multiple checks using crontab for AND operations....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 08:47 PM
06-11-2007 08:47 PM
Re: How do I create a cron job?
Or you must use C boolean operators.
>(15,27,28) on 15th, 27th and 28th of every month (1-5) from monday to friday.
So you want it to run on 15,27,28 ONLY when it is also Monday-Friday? Boolean AND.
>Mridul: Then in the script ... you need to check either it is Mon-Friday
DOW=$(date +'%w')
if [ $DOW -eq 0 -o $DOW -eq 6 ]; then
exit 0 # exit on Sun or Sat
fi
>Mridul: I don't find anything to do multiple checks using crontab for AND operations
tztab(4) lets you do AND, so don't confuse them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 08:49 PM
06-11-2007 08:49 PM
Re: How do I create a cron job?
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007 11:24 PM
06-11-2007 11:24 PM
Re: How do I create a cron job?
You are all very helpful.... Thanks a lot. I need clear cut example to understand this new field. Thanks a lot. I'm sorry if you are not happy with the points I rated. No worries, I'll post lotsa more questions here. :) Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2007 12:50 PM
06-12-2007 12:50 PM