- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- about the crontab
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
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
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
08-31-2005 01:55 PM
08-31-2005 01:55 PM
0 9 10-31 * 1-5
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 02:21 PM
08-31-2005 02:21 PM
Re: about the crontab
IT means your command will run at 9:00 from 10th to 32st each month and from monday to friday. If 1st ->9th falls to monday and friday you sript still execute.. -> BECAREFUL.I HAVE ONCE CASE LIKE THIS.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 02:25 PM
08-31-2005 02:25 PM
Re: about the crontab
As far as I know with cron there is nothing to specify what you are after, which is every monday to friday. I would set it up like
0 9 10-31 * * <script_name>
and then put a quick day of the week check in the beginning of the script to exit out if its not a weekday.
HTH
Steph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 02:52 PM
08-31-2005 02:52 PM
Re: about the crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 03:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 04:05 PM
08-31-2005 04:05 PM
Re: about the crontab
0 9 10-31 * 1-5 command will run at 9:00 from 10th to 31st each month and from monday to friday.
Not sure if it will skip 1 to 9th , as 1-5( that is Monday - to Friday) specified. Seems you need to control at the job level to set this.
Cheers ,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 04:06 PM
08-31-2005 04:06 PM
Re: about the crontab
here is a solution. Leave the crontab with
0 9 10-31 * 1-5 scriptname
In the script add the check
#!/bin/ksh
curdate=`/usr/bin/date | awk '{ print $3 }'`
if [ "$curdate" > "9" ] ; then
batchjob
fi
this will run the batch job Mon through Friday only if the date is greater than 9
Hope this will resolve your issue
thanks
DP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 04:10 PM
08-31-2005 04:10 PM
Re: about the crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 07:25 PM
09-07-2005 07:25 PM
Re: about the crontab
I tried your method , it work perfect , but I am wonder the crontab job condition ( minute ,time , date , month , year ) are not "AND" relation , it seems the job not to be run only when fullfit all conditions , they seems are "OR" relation. If not use Pant' method , is it possible to meet my requirement by just use crontab function ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 07:39 PM
09-07-2005 07:39 PM
Re: about the crontab
Cron is a rather simple scheduling tool, as pointed out in previous posts, it is not always possible (as in your case) to perform scheduling without using additional tests in the script.