| Summary: | @monthly entry in crontab is run every day | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Andre Albsmeier <Andre.Albsmeier> |
| Component: | bin | Assignee: | Mike Heffner <mikeh> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.1-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Andre Albsmeier
2000-09-09 20:40:01 UTC
Responsible Changed From-To: freebsd-bugs->mikeh I'll look into this. FWIW, it also appears there is a problem with @weekly (misc/29389). 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)) { 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
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> 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 Fix MFC'd. |