Bug 705035

Summary: A more complex crontab line fails to work
Product: Red Hat Enterprise Linux 6 Reporter: Colin.Simpson
Component: cronieAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0Keywords: FutureFeature
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-24 10:02:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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