Bug 1377727 - Cron job gets executed at incorrect date
Summary: Cron job gets executed at incorrect date
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: cronie
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-20 13:11 UTC by colin.fletcher
Modified: 2016-09-20 15:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-20 15:34:11 UTC
Type: Bug


Attachments (Terms of Use)

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.


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