From: Kern Sibbald Date: Thu, 22 Mar 2007 21:11:49 +0000 (+0000) Subject: kes Implement new prunning code that prunes up to 1000 jobs at X-Git-Tag: Release-7.0.0~6740 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=14b268a8f3be709a355b09743cce0e4235a0ded6;p=bacula%2Fbacula kes Implement new prunning code that prunes up to 1000 jobs at the same time. The same technique can be applied to a number of other prune/purge subroutines. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4384 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/run_conf.c b/bacula/src/dird/run_conf.c index b92ee123e7..5fe71ab044 100644 --- a/bacula/src/dird/run_conf.c +++ b/bacula/src/dird/run_conf.c @@ -339,6 +339,7 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) for ( ; token != T_EOL; (token = lex_get_token(lc, T_ALL))) { int len; bool pm = false; + bool am = false; switch (token) { case T_NUMBER: state = s_mday; @@ -434,6 +435,7 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) if (!have_hour) { clear_bits(0, 23, lrun.hour); } +// Dmsg1(000, "s_time=%s\n", lc->str); p = strchr(lc->str, ':'); if (!p) { scan_err0(lc, _("Time logic error.\n")); @@ -441,20 +443,19 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) } *p++ = 0; /* separate two halves */ code = atoi(lc->str); /* pick up hour */ + code2 = atoi(p); /* pick up minutes */ len = strlen(p); - if (len > 2 && p[len-1] == 'm') { - if (p[len-2] == 'a') { - pm = false; - } else if (p[len-2] == 'p') { - pm = true; - } else { - scan_err0(lc, _("Bad time specification.")); - /* NOT REACHED */ - } - } else { - pm = false; + if (len >= 2) { + p += 2; } - code2 = atoi(p); /* pick up minutes */ + if (strcasecmp(p, "pm") == 0) { + pm = true; + } else if (strcasecmp(p, "am") == 0) { + am = true; + } else if (len != 2) { + scan_err0(lc, _("Bad time specification.")); + /* NOT REACHED */ + } /* * Note, according to NIST, 12am and 12pm are ambiguous and * can be defined to anything. However, 12:01am is the same @@ -467,13 +468,14 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) code += 12; } /* am */ - } else if (code == 12) { + } else if (am && code == 12) { code -= 12; } if (code < 0 || code > 23 || code2 < 0 || code2 > 59) { scan_err0(lc, _("Bad time specification.")); /* NOT REACHED */ } +// Dmsg2(000, "hour=%d min=%d\n", code, code2); set_bit(code, lrun.hour); lrun.minute = code2; have_hour = true; diff --git a/bacula/src/version.h b/bacula/src/version.h index e3c9c0e88e..f2979fedd0 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.1.5" -#define BDATE "18 March 2007" -#define LSMDATE "18Mar07" +#define VERSION "2.1.6" +#define BDATE "22 March 2007" +#define LSMDATE "22Mar07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */