int period = 0, bypass = 0;
switch (jr->named_period)
{
- case 1:
+ case 1: /* monthly */
period = days_last_month ();
bypass = days_this_month ();
break;
- case 2:
+ case 2: /* yearly, annualy */
period = days_last_year ();
bypass = days_this_year ();
break;
+ case 3: /* daily */
+ period = 1;
+ bypass = 1;
+ break;
+ case 4: /* weekly */
+ period = 7;
+ bypass = 7;
+ break;
default:
die ("Unknown named period for %s (%d)", jr->ident, jr->named_period);
}
jr = obstack_alloc(&tab_o, sizeof(job_rec));
if (!strncmp ("@monthly", periods, 7)) {
- jr->named_period = 1;
- } else if (!strncmp("@yearly", periods, 7)) {
- jr->named_period = 2;
+ jr->named_period = 1;
+ } else if (!strncmp("@yearly", periods, 7) || !strncmp("@annualy", periods, 8)) {
+ jr->named_period = 2;
+ } else if (!strncmp ("@daily", periods, 7)) {
+ jr->named_period = 3;
+ } else if (!strncmp ("@weekly", periods, 7)) {
+ jr->named_period = 4;
} else {
- complain("%s: Unknown named period on line %d, skipping",
- anacrontab, line_num);
+ complain("%s: Unknown named period on line %d, skipping",
+ anacrontab, line_num);
}
jr->period = 0;
delay += random_number;
-.TH ANACRONTAB 5 2009-07-17 "Marcela Mašláňová" "Anacron Users' Manual"
+.TH ANACRONTAB 5 2009-08-17 "Marcela Mašláňová" "Anacron Users' Manual"
.SH NAME
/etc/anacrontab \- configuration file for anacron
.SH DESCRIPTION
can be any shell command. The fields can be seperated by blank spaces or tabs.
The
.I period_name
-can only be set to monthly at the present time. This will ensure jobs
-are only run once a month, no matter the number of days in this month,
-or the previous month.
+can be set to daily, weekly, monthly, yearly or annualy. This will ensure jobs
+are run once a week, month or year no matter the number of days in this period.
.PP
Environment assignment lines are of the form:
.PP