crontab : day-of-month support for last-day-of-month

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Tue Aug 30 13:49:57 GMT 2005


Nicolas Blais <nb_root at videotron.ca> writes:

> Does our crontab allow the use of "L" (as found on 
> http://wiki.opensymphony.com/display/QRTZ1/CronTriggers+Tutorial?decorator=printable) 
> in the day-of-month field which would allow for a job to run on a 31th or feb 
> 28? 
> 
> It would be useful for certain apps like /www/awstats to update their database 
> on the last hour of the month since putting the cron job on the 1st of the 
> month makes the software update in a new month and putting it on the 30th of 
> the month might loose 1 day.

No, we don't have such a capability.  If you go ahead and add it,
please note a few points:

 - There are workarounds that have been around a long time.  Longer
   than Vixie's version of cron, even.

 - It's not as advantageous as it seems at first glance.  Remember
   that various issues beyond the control of cron may cause the job to
   end up being executed in the new month anyway.  So the job you are
   running from cron really needs to be able to handle running in the
   new month, and it is generally simpler to assume that will be the
   case and backdate the file names than to handle it as an error
   case.

 - This particular syntax seems to be unique to the the program
   ("Quartz") you're looking at.  Porting it to FreeBSD might be a
   useful alternative to reimplementing its features (although it
   sounds like vast overkill for your case).

Good luck.


More information about the freebsd-questions mailing list