From wayne@barnes1.wustl.edu  Sat Sep 30 08:48:31 2000
Return-Path: <wayne@barnes1.wustl.edu>
Received: from barnes1.wustl.edu (barnes1.wustl.edu [128.252.68.11])
	by hub.freebsd.org (Postfix) with ESMTP id 0465437B502
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Sep 2000 08:48:31 -0700 (PDT)
Received: (from wayne@localhost)
	by barnes1.wustl.edu (8.9.3/8.9.2) id KAA33927;
	Sat, 30 Sep 2000 10:55:07 -0500 (CDT)
	(envelope-from wayne)
Message-Id: <200009301555.KAA33927@barnes1.wustl.edu>
Date: Sat, 30 Sep 2000 10:55:07 -0500 (CDT)
From: wayne@barnes1.wustl.edu
Reply-To: wayne@barnes1.wustl.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: crontab mishandles day range
X-Send-Pr-Version: 3.2

>Number:         21660
>Category:       bin
>Synopsis:       crontab mishandles day range
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 30 08:50:02 PDT 2000
>Closed-Date:    Tue May 29 22:21:27 PDT 2001
>Last-Modified:  Tue May 29 22:24:40 PDT 2001
>Originator:     Wayne M Barnes
>Release:        FreeBSD 3.5-STABLE i386
>Organization:
Washington University 
>Environment:
Nothing special.
	

>Description:
The following crontab line is intended to execute only on the 2d Friday
of every month, but it executes every Friday morning.
8 8 8-14 * 5 mail -s "Pickup request" eoates < /home/wayne/mail/biohazard.mai

	

>How-To-Repeat:
Put the following line into your crontab, with you instead of eoates as
recipient, and with the name of an existing short text file (such as
a copy of this email) after the <

Line to put in using the command 'crontab -e' "
8 8 8-14 * 5 mail -s "Pickup request" eoates < /home/wayne/mail/biohazard.mai

Then, wait until Friday.  If you get the message, and the day of the month
is not in the range 8-14, you have the problem, too.

	

>Fix:
	
	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: peter 
Responsible-Changed-When: Mon Oct 2 12:02:01 PDT 2000 
Responsible-Changed-Why:  
misfiled PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21660 

From: Gerhard Sittig <Gerhard.Sittig@gmx.net>
To: wayne@barnes1.wustl.edu
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/21660: crontab mishandles day range
Date: Sat, 13 Jan 2001 20:31:18 +0100

 On Sat, Sep 30, 2000 at 10:55 -0500, wayne@barnes1.wustl.edu wrote:
 > 
 > >Synopsis:       crontab mishandles day range
 > >Release:        FreeBSD 3.5-STABLE i386
 > >Description:
 > The following crontab line is intended to execute only on the
 > 2d Friday of every month, but it executes every Friday morning.
 > 8 8 8-14 * 5 mail -s "Pickup request" eoates < /home/wayne/mail/biohazard.mai
 
 Could you please check your system's crontab(5) manpage?  Here it
 looks like this:
 
 -----------------------------------------------------------------
 %uname -sr
 FreeBSD 4.2-STABLE
 %man 5 crontab
 [ ... ]
      Note: The day of a command's execution can be specified by two fields --
      day of month, and day of week.  If both fields are restricted (ie, aren't
      *), the command will be run when either field matches the current time.
 [ ... ]
 -----------------------------------------------------------------
 
 The part of "either field" is emphasized.  If your manpage tells
 you the same, it seems that you have to find a different method
 of specifying your intension.  The easiest would probably be to
 wildcard the DOW part and wrap your mail command into a script
 which quickly checks `date '+%w'` output to be 5.
 
 
 virtually yours   82D1 9B9C 01DC 4FB4 D7B4  61BE 3F49 4F77 72DE DA76
 Gerhard Sittig   true | mail -s "get gpg key" Gerhard.Sittig@gmx.net
 -- 
      If you don't understand or are scared by any of the above
              ask your parents or an adult to help you.
 
State-Changed-From-To: open->closed 
State-Changed-By: unfurl 
State-Changed-When: Tue May 29 22:21:27 PDT 2001 
State-Changed-Why:  
This was never a problem to begin with, just a misunderstanding of how 
crontab works. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21660 
>Unformatted:
