- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron jobs
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
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
05-23-2004 09:58 PM
05-23-2004 09:58 PM
cron jobs
1. it should run everyday
2. it should run from 3a.m. to 12 midnight every minute.
OR
it should run from 4p.m. to 12 midnight every minute
OR
it should run from 3.10 p.m. to 11.35 p.m. midnight every minute or every hour
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:07 PM
05-23-2004 10:07 PM
Re: cron jobs
See "at" on man.
Regards
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:14 PM
05-23-2004 10:14 PM
Re: cron jobs
It can be done by
create a file in
/var/spool/cron/crontabs
#minute hour monthday month weekday cmd
* 3 * * *
Now submit the cron job by
crontab /var/spool/cron/crontabs/
Not sure about the values for your case but the method is this.
The above values are a guess for you case pls try it
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:23 PM
05-23-2004 10:23 PM
Re: cron jobs
you can achieve it using the same job in several lines
0-59 15-23 * * 1 myjob.sh
0-59 16-23 * * 2 myjob.sh
this example would run myjob each minute interval from 3pm to midnight on a Monday then from 4pm to midnight on a tuesday
:-) John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:23 PM
05-23-2004 10:23 PM
Re: cron jobs
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:25 PM
05-23-2004 10:25 PM
Re: cron jobs
You have to put in your crontab something like this:
10 15 1,2,3,4,5,6,7,8 * * * "your_command"
"your_command" should run from 15.10 until 23.10, would have to run every 1 hours!
For further information look "man crontab".
Regards Ernesto.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:32 PM
05-23-2004 10:32 PM
Re: cron jobs
The easiest way would be to put up a job in cron to run every day and in that script you check for times 3.00am to 12 midnight or the other options that you want.
As some one has mentioned, you should look at using 'at' command
regards
Mobeen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 10:58 PM
05-23-2004 10:58 PM
Re: cron jobs
to be honest I do not understand the question. What do you mean with the OR's in your question? How do you determine if the job should be started according to condition 2a OR 2b OR 2c?
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 11:04 PM
05-23-2004 11:04 PM
Re: cron jobs
> it should run from 3a.m. to 12 midnight every minute.
* 3-11 * * * command
with this config, command run at 3:00, 3:01, 3:02,... - 11:59.
> it should run from 4p.m. to 12 midnight every minute
* 16-23 * * * command
> it should run from 3.10 p.m. to 11.35 p.m. midnight every minute or every hour
you should set three line config.
10-59 15 * * * command
* 16-22 * * * command
0-34 23 * * * command
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 11:19 PM
05-23-2004 11:19 PM
Re: cron jobs
'OR' I mean if any condition I use in crontab. That's all. Not necessary that I will use all the 'OR' conditions in crontab. Actually I want to know commands at different situations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 11:23 PM
05-23-2004 11:23 PM
Re: cron jobs
Ernesto,
I tried your command. It is not working. Pls suggest something else.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2004 11:33 PM
05-23-2004 11:33 PM
Re: cron jobs
You can not do this with one cron entry youwill have to use several as John mentions above.
However, the format of a crontab is like this
MIN HOUR DAY MONTH DAYOFWEEK (0 is Sunday) COMMAND
So your first example would be
0-59 3-23 * * * command
The second one would be
0-59 16-23 * * * command
For once an hour between 3pm and 10pm you'd do something like
0 15-20 * * * command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2004 01:09 AM
05-24-2004 01:09 AM
Re: cron jobs
#minute (0-59),
#| hour (0-23),
#| | day of the month (1-31),
#| | | month of the year (1-12),
#| | | | day of the week (0-6 with 0=Sunday).
#| | | | | commands
#0 2 * * 0,4 /rcd/scripts/myjob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2004 01:18 AM
05-24-2004 01:18 AM
Re: cron jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2004 01:31 AM
05-24-2004 01:31 AM
Re: cron jobs
it seems you have been given a good explanation of how cron works maybe if you could tell in more detail what you are trying to achieve we can help you with a working solution.
:-) John.