crontab ignores the day of month, and executes based only on the time and the weekday.

Bug #1545108 reported by Rob
6
This bug affects 1 person
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
ProcVersionSignature: Ubuntu 3.13.0-77.121-generic 3.13.11-ckt32
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)

Revision history for this message
Rob (ubuntu-clearblueskies) wrote :
Revision history for this message
Rob (ubuntu-clearblueskies) wrote :

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.

Changed in cron (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.