From andre.albsmeier@mchp.siemens.de  Sat Sep  9 12:35:30 2000
Return-Path: <andre.albsmeier@mchp.siemens.de>
Received: from goliath.siemens.de (goliath.siemens.de [194.138.37.131])
	by hub.freebsd.org (Postfix) with ESMTP id 87A2837B422
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  9 Sep 2000 12:35:29 -0700 (PDT)
Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14])
	by goliath.siemens.de (8.10.1/8.10.1) with ESMTP id e89JZR409905
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 9 Sep 2000 21:35:27 +0200 (MET DST)
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7])
	by mail3.siemens.de (8.11.0/8.11.0) with ESMTP id e89JZQk7799003
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 9 Sep 2000 21:35:26 +0200 (MEST)
Received: (from localhost)
	by curry.mchp.siemens.de (8.11.0/8.11.0) id e89JZQo77336
	for FreeBSD-gnats-submit@freebsd.org; Sat, 9 Sep 2000 21:35:26 +0200 (CEST)
Message-Id: <200009091935.e89JZQa36439@curry.mchp.siemens.de>
Date: Sat, 9 Sep 2000 21:35:26 +0200 (CEST)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: @monthly entry in crontab is run every day
X-Send-Pr-Version: 3.2

>Number:         21152
>Category:       bin
>Synopsis:       @monthly entry in crontab is run every day
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mikeh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 09 12:40:01 PDT 2000
>Closed-Date:    Sat Aug 18 07:39:47 PDT 2001
>Last-Modified:  Sat Aug 18 07:40:05 PDT 2001
>Originator:     Andre Albsmeier
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
>Environment:

FreeBSD 4.1-STABLE

>Description:

Crontab entries using @monthly are run daily

>How-To-Repeat:

Put an @monthly entry in crontab and wait one day

>Fix:



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mikeh 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Thu Aug 2 17:31:00 PDT 2001 
Responsible-Changed-Why:  
I'll look into this. FWIW, it also appears there is a problem with @weekly (misc/29389). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21152 

From: Mike Heffner <mheffner@novacoxmail.com>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: "Alexander S. Usov" <usov@ukr.net>,
	freebsd-gnats-submit@freebsd.org,
	FreeBSD-bugs <freebsd-bugs@freebsd.org>
Subject: Re: bin/21152: @monthly entry in crontab is run every day
Date: Tue, 14 Aug 2001 23:45:24 -0400 (EDT)

 Can you see whether the following, untested, patch works? It should fix the
 @monthly and @weekly entries. Also, it should fix the @yearly/@annually entry
 so that it doesn't execute daily during January.
 
 
 Thanks,
 
 Mike
 
 -- 
   Mike Heffner         <mheffner@[acm.]vt.edu>
   Fredericksburg, VA       <mikeh@FreeBSD.org>
 
 
 
 
 Index: entry.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/cron/lib/entry.c,v
 retrieving revision 1.14
 diff -u -r1.14 entry.c
 --- entry.c     2001/07/18 11:49:45     1.14
 +++ entry.c     2001/08/15 03:40:59
 @@ -156,6 +156,7 @@
                         bit_set(e->dom, 0);
                         bit_set(e->month, 0);
                         bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
 +                       e->flags |= DOW_STAR;
                 } else if (!strcmp("monthly", cmd)) {
                         Debug(DPARS, ("load_entry()...monthly shortcut\n"))
                         bit_set(e->minute, 0);
 @@ -163,11 +164,13 @@
                         bit_set(e->dom, 0);
                         bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
                         bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
 +                       e->flags |= DOW_STAR;
                 } else if (!strcmp("weekly", cmd)) {
                         Debug(DPARS, ("load_entry()...weekly shortcut\n"))
                         bit_set(e->minute, 0);
                         bit_set(e->hour, 0);
                         bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1));
 +                       e->flags |= DOM_STAR;
                         bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
                         bit_set(e->dow, 0);
                 } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) {
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Mike Heffner <mheffner@vt.edu>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	"Alexander S. Usov" <usov@ukr.net>, freebsd-gnats-submit@freebsd.org,
	FreeBSD-bugs <freebsd-bugs@freebsd.org>
Subject: Re: bin/21152: @monthly entry in crontab is run every day
Date: Wed, 15 Aug 2001 09:48:27 +0200

 On Tue, 14-Aug-2001 at 23:45:24 -0400, Mike Heffner wrote:
 > Can you see whether the following, untested, patch works? It should fix the
 > @monthly and @weekly entries. Also, it should fix the @yearly/@annually entry
 
 Done! I have added weekly and monthly test entries in my crontab
 and we will see.
 
 Thanks so far,
 
 	-Andre

From: Mike Heffner <mheffner@novacoxmail.com>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: FreeBSD-bugs <freebsd-bugs@freebsd.org>,
	freebsd-gnats-submit@freebsd.org, "Alexander S. Usov" <usov@ukr.net>
Subject: Re: bin/21152: @monthly entry in crontab is run every day
Date: Wed, 15 Aug 2001 20:10:57 -0400 (EDT)

 On 15-Aug-2001 Andre Albsmeier wrote:
 | On Tue, 14-Aug-2001 at 23:45:24 -0400, Mike Heffner wrote:
 |> Can you see whether the following, untested, patch works? It should fix the
 |> @monthly and @weekly entries. Also, it should fix the @yearly/@annually
 |> entry
 | 
 | Done! I have added weekly and monthly test entries in my crontab
 | and we will see.
 
 I've tested these by changing the date back and forth, and as far as I can tell
 they're correct. I'll probably commit them within the next few days.
 
 Mike
 
 -- 
   Mike Heffner         <mheffner@[acm.]vt.edu>
   Fredericksburg, VA       <mikeh@FreeBSD.org>
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Mike Heffner <mheffner@vt.edu>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	FreeBSD-bugs <freebsd-bugs@freebsd.org>,
	freebsd-gnats-submit@freebsd.org, "Alexander S. Usov" <usov@ukr.net>
Subject: Re: bin/21152: @monthly entry in crontab is run every day
Date: Thu, 16 Aug 2001 07:19:00 +0200

 On Wed, 15-Aug-2001 at 20:10:57 -0400, Mike Heffner wrote:
 > 
 > On 15-Aug-2001 Andre Albsmeier wrote:
 > | On Tue, 14-Aug-2001 at 23:45:24 -0400, Mike Heffner wrote:
 > |> Can you see whether the following, untested, patch works? It should fix the
 > |> @monthly and @weekly entries. Also, it should fix the @yearly/@annually
 > |> entry
 > | 
 > | Done! I have added weekly and monthly test entries in my crontab
 > | and we will see.
 > 
 > I've tested these by changing the date back and forth, and as far as I can tell
 
 This I didn't want to do since I don't have machines for playing at
 the moment. But it seems the @monthly entry didn't get executed
 last night as it did before :-)
 
 > they're correct. I'll probably commit them within the next few days.
 
 Might be nice to see this fix go in 4.4 before release :-)
 
 Thanks,
 
 	-Andre
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Sat Aug 18 07:39:47 PDT 2001 
State-Changed-Why:  
Fix MFC'd. 

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