- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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
04-11-2002 12:34 AM
04-11-2002 12:34 AM
I am not an expert in UX, just migrated from. So, the question i am putting up might be stupid, but please bear with me.
Q)* * 1-7 * 6 job
Would this run on the 1st saturday of the month or would it run on first 7 days as well as on all saturdays?
Thanks for you patience!
Ben
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:42 AM
04-11-2002 12:42 AM
Re: Cron job
This is the syntax
minute hour monthday month weekday command
not sure what overrides the other.
of course, there's no harm in testing is there??
Grt, Emiel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:45 AM
04-11-2002 12:45 AM
Re: Cron job
From the man page of crontab:
...
Note that the
specification of days can be made in two fields: monthday and weekday
If both are specified in an entry, they are cumulative. For example,
0 0 1,15 * 1 command
runs command at midnight on the first and fifteenth of each month, as
well as every Monday.
...
Hope this clarifies it!
Cheers,
Deepak.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:46 AM
04-11-2002 12:46 AM
Re: Cron job
Note that the
specification of days can be made in two fields: monthday and weekday.
If both are specified in an entry, they are cumulative. For example,
0 0 1,15 * 1 command
runs command at midnight on the first and fifteenth of each month, as
well as every Monday.
hope it answers your problem,
grt, Emiel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:46 AM
04-11-2002 12:46 AM
Re: Cron job
It will run on first 7 days as well as on all saturdays.
-Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:50 AM
04-11-2002 12:50 AM
Re: Cron job
Just pointing this out, because its not everyday that one sees a '*' in the Minute and Hour field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:50 AM
04-11-2002 12:50 AM
Re: Cron job
I think 1-7 means on each day and if you had 1,7 it would mean day 1 and day 7.
Your job will run the first even days of the month and each saturday
checkout man cron
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 12:53 AM
04-11-2002 12:53 AM
Re: Cron job
I think it will run as you've suspected.
What I would it to work out the particular
date relevant through a script, before
proceeding to run the jobs.
Personally I would use something like the
information provided from the following
thread. I've utilised it on a number of
occassions and it really works well.
Our collegue Mr Stephenson has done a wonderful
job with this.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe752d20fd34bd61190010090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 01:31 AM
04-11-2002 01:31 AM
Re: Cron job
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 01:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 02:40 AM
04-11-2002 02:40 AM
Re: Cron job
That was simple and to the point. Now i wonder why i didnt think of it in the first place :(
Thanks a lot
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 03:01 AM
04-11-2002 03:01 AM
Re: Cron job
0 0 * * 6 job
#!/usr/bin/ksh
if [ $(date +%d) -lt 8 ]
then
fi
is this really what you want, using this method "job" will only run once on the first Saturday of the month as subsequent saturdays the test will say date days is greater than 7 and not do anything.
If you only want the job to run on the first saturday use cron
* * * 6 * job
John.