crontab ignores the day of month, and executes based only on the time and the weekday.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cron (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
here is my crontab:
45 5 * * 1-5 pkill -f flash
48 6 * * 1-5 musicalarm
50 9 * * 1-5 mpc random off
30 7 5 2 5 echo -e "I'm not coming in today.\n\nHave a good one!" | mail -s "No pikupordropov needed" <email address hidden>
Obviously I have changed the email a bit, but it gives you an idea. The email got sent today, even though it is clearly not the 5th of February. Something similar happened a couple days ago (another command that was scheduled for that day, but earlier in the month).
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: cron 3.0pl1-124ubuntu2
ProcVersionSign
Uname: Linux 3.13.0-77-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: amd64
Date: Fri Feb 12 10:33:41 2016
InstallationDate: Installed on 2014-02-04 (738 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
SourcePackage: cron
UpgradeStatus: Upgraded to trusty on 2014-07-20 (571 days ago)
So, I just learned that if I have a crontab with both the day of month and day of week fields set, it will run on both the given weekday and given the day of the month, and to have a crontab only work on a certain day of the month, the day of week field should be set to an asterisk.