- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Crontab
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
09-13-2002 01:18 AM
09-13-2002 01:18 AM
eg.
Run the schedule task from 9am to 17pm but except 1pm ??? 2pm
0,30 9-17 * * * schedule task
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 01:24 AM
09-13-2002 01:24 AM
Re: Crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 01:25 AM
09-13-2002 01:25 AM
Re: Crontab
0,30 9-12,15-17 * * * schedule task
or
0,30 9,10,11,12,15,16,17 * * * schedule task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 01:25 AM
09-13-2002 01:25 AM
Re: Crontab
I don't think it's possible to do.
As my opinion, I will either separate the cronjob into 2 time range or just skip your time range in your schedule task.
Regards,
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 01:27 AM
09-13-2002 01:27 AM
Re: Crontab
workaround to your example: you need two crontab entries, one for 9-13 and one for 14-17.
regards
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 01:33 AM
09-13-2002 01:33 AM
SolutionMaybe the alternative is to run the script/program but place the time check in the script/program itself??
The following could be placed in a script to stop a job running if the hour resturns as 10.
#!/bin/sh
TEST=`date +%H`
if [ $DATE = 10 ]
then
exit 1
else
run-job.sh
fi
Hope that helps. Thinking sideways is always an art form.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 02:14 AM
09-13-2002 02:14 AM
Re: Crontab
Perhaps I have misunderstod something but I can't see why this should not could be done in one line.
I made a simple test (but with minutes instead of hours.
# crontab -l
10-15,51-54,56-59 * * * * date >>/tmp/abc
#
# cat abc
date
Fri Sep 13 03:51:01 MDT 2002
Fri Sep 13 03:52:00 MDT 2002
Fri Sep 13 03:53:00 MDT 2002
Fri Sep 13 03:54:00 MDT 2002
Fri Sep 13 03:56:00 MDT 2002
Fri Sep 13 03:57:00 MDT 2002
Fri Sep 13 03:58:00 MDT 2002
Fri Sep 13 03:59:00 MDT 2002
Fri Sep 13 04:10:00 MDT 2002
Fri Sep 13 04:11:00 MDT 2002
Fri Sep 13 04:12:00 MDT 2002
Fri Sep 13 04:13:00 MDT 2002
Fri Sep 13 04:14:00 MDT 2002
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 02:16 AM
09-13-2002 02:16 AM
Re: Crontab
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 04:26 AM
09-13-2002 04:26 AM
Re: Crontab
0,30 9-12,14-17 * * * myJob
or
0,30 9,10,11,12,14,15,16,17 * * * myJob
This should fire off at the 0 and 30 minutes of every hour 9, 10, 11, 12, then skip the 0 and 30 minutes of 1pm, then fire off the 0 and 30 minutes of 2pm, 3, 4, and 5.
I assume lunch hour is being skipped.
Am I missing something?
- Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2002 04:43 AM
09-13-2002 04:43 AM
Re: Crontab
Leif's solution is simple, commonly accepted, and in a word "correct".
Darrell