Bug 1377727

Summary: Cron job gets executed at incorrect date
Product: [Fedora] Fedora Reporter: colin.fletcher
Component: cronieAssignee: Tomas Mraz <tmraz>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: mmaslano, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-20 15:34:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description colin.fletcher 2016-09-20 13:11:18 UTC
Description of problem:
Create a crontab entry to run an send an email at 8:00 am on Monday, Tuesday and Wednesday within the first ten days of the month.  The cron job was executed today, 20th of the month.

Version-Release number of selected component (if applicable):
Installed Packages
Name        : cronie
Arch        : x86_64
Version     : 1.4.4
Release     : 15.el6_7.1
Size        : 174 k
Repo        : installed
From repo   : updates
Summary     : Cron daemon for executing programs at set times
URL         : https://fedorahosted.org/cronie
License     : MIT and BSD and ISC and GPLv2
Description : Cronie contains the standard UNIX daemon crond that runs specified programs at
            : scheduled times and related tools. It is a fork of the original vixie-cron and
            : has security and configuration enhancements like the ability to use pam and
            : SELinux.

How reproducible:
Every time.

Steps to Reproduce:
1. crontab -e
2. add this entry: 0 8 1-10 * 1,2,3 /path/to/a/script.sh
3. save the crontab
4. wait for 8:00am on Mon,Tues,Wed after the 10th of the month

Actual results:
The script executed

Expected results:
The script will only execute on the specified days/dates

Additional info:
N/A

Comment 1 Tomas Mraz 2016-09-20 15:34:11 UTC
Citing manual page crontab(5):
Note:  The day of a command's execution can be specified in the follow‐
       ing 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.