Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2007 12:55:02 +0200 (CEST)
From:      "Raphael Becker" <rabe@uugrn.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        rabe@rabe.uugrn.org
Subject:   docs/113194: crontab.5: handling of day-in-month plus day-in-week seems to be a bug/feature?
Message-ID:  <200705311055.l4VAt2q0091729@top.uugrn.org>
Resent-Message-ID: <200705311130.l4VBU6KR036055@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         113194
>Category:       docs
>Synopsis:       crontab.5: handling of day-in-month plus day-in-week seems to be a bug/feature?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 31 11:30:06 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Raphael Becker
>Release:        FreeBSD 6.2-RELEASE-p1 i386
>Organization:
UUGRN e.V. 
>Environment:
System: FreeBSD top.uugrn.org 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #1: Sun Feb 18 19:59:49 CET 2007 root@top.uugrn.org:/usr/obj/usr/src_RELENG_6_2/sys/TOP i386


	
>Description:
	If you try to express "monday before second thursday in month" 
	(announce for our monthly UUG meeting) you might want to setup 
	a cron like 
		0 0 5-11 * 1 ~/bin/announce.sh

        Following the "Note" (see patch) section about the two day-fields 
	this would end in
		"every day from 5th to 11th plus every monday". 

	Therefore you cannot express "monday before second thursday in month".

	If the behaviour of the two fields would be logical "and" it should work 
	and if you really need to express "every day from 5th to 11th plus every monday" 
	you easily could set up two lines with an asterisk for the 3rd or the 5th 
	field.

	So we have some unneded redundancy here plus the lack of a reasonable 
	facility. So this "feature" should go into the "Bugs" section of crontab.5
	
	Maybe someone would patch the behaviour.
	

>How-To-Repeat:
	
>Fix:

--- crontab.5.orig      Thu May 31 12:24:47 2007
+++ crontab.5   Thu May 31 12:27:05 2007
@@ -208,17 +208,6 @@
 after the first % will be sent to the command as standard
 input.
 .Pp
-Note: The day of a command's execution can be specified by two
-fields \(em day of month, and day of week.
-If both fields are
-restricted (ie, are not *), the command will be run when
-.Em 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.
-.Pp
 Instead of the first five fields,
 one of eight special strings may appear:
 .Bd -literal -offset indent
@@ -295,6 +284,17 @@
 .Sh AUTHORS
 .An Paul Vixie Aq paul@vix.com
 .Sh BUGS
+Note: The day of a command's execution can be specified by two
+fields \(em day of month, and day of week.
+If both fields are
+restricted (ie, are not *), the command will be run when
+.Em 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.
+.Pp
 If you are in one of the 70-odd countries that observe Daylight
 Savings Time, jobs scheduled during the rollback or advance will be
 affected.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705311055.l4VAt2q0091729>