Bug 705035 - A more complex crontab line fails to work
Summary: A more complex crontab line fails to work
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cronie
Version: 6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Marcela Mašláňová
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-16 13:12 UTC by Colin.Simpson
Modified: 2011-06-24 10:02 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-24 10:02:35 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Colin.Simpson 2011-05-16 13:12:04 UTC
Description of problem:

I wanted to setup a cron job that would only run on the third Sunday of the month. A clean way of doing this is, that I've seen used elsewhere is:

38 6 15-21 * 7 /usr/local/sbin/lclcheck

This should run at 06:38 on any Sunday between the 15th and the 21st of a month.
Which should lead to 

Version-Release number of selected component (if applicable):
cronie-1.4.4-2.el6.x86_64

How reproducible:


Steps to Reproduce:
1. Adding a cronjob as above
  

Actual results:

It runs every morning (well has so far), and not just Sunday.

May 15 06:38:01 rhel6srv CROND[3057]: (root) CMD (/usr/local/sbin/lclcheck)
May 16 06:38:01 rhel6srv CROND[12798]: (root) CMD (/usr/local/sbin/lclcheck)


Expected results:

May 15 06:38:01 rhel6srv CROND[3057]: (root) CMD (/usr/local/sbin/lclcheck)

Should only run on the Sunday in the date range.

Additional info:

Maybe this is just a known limitation of cron.

Comment 2 Marcela Mašláňová 2011-05-16 14:37:13 UTC
I suppose it runs from 15 to 21 of month + every Sunday. That's how cron works.
<cite>
Note:  The  day  of  a  command's  execution can be specified in the following two fields — 'day of month', and 'day of week'.  If both fields are restricted (i.e., do not contain the "*" character), the command will be run when either field matches the current time.  For example, "30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
</cite>

There would be needed new feature which somehow marked that it should be only Sundays in this interval.

Comment 3 Marcela Mašláňová 2011-06-24 10:02:35 UTC
Because this is know limitation, I'm closing this bug, but I create one in my track for possible future implementation.

https://fedorahosted.org/cronie/ticket/9


Note You need to log in before you can comment on or make changes to this bug.