Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2001 23:45:24 -0400 (EDT)
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
Message-ID:  <XFMail.20010814234524.mheffner@novacoxmail.com>

next in thread | raw e-mail | index | archive | help
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)) {


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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