Skip to content

Commit

Permalink
Status scheduler now shows disabled jobs
Browse files Browse the repository at this point in the history
We now only display the Level= if a level really
is set in the run entry.

Also, we now print the year in the preview.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
pstorz authored and Marco van Wieringen committed May 5, 2013
1 parent f7a84fa commit 3b3d00c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/dird/ua_status.c
Expand Up @@ -434,8 +434,10 @@ static void show_scheduled_preview(UAContext *ua, SCHEDRES *sched, struct tm tm,
ua->send_msg(dt);
ua->send_msg(" %-22.22s ", sched->hdr.name);

bstrncpy(level, level_to_str(run->level), sizeof(level));
ua->send_msg("Level=%s ", level);
if (run->level) {
bstrncpy(level, level_to_str(run->level), sizeof(level));
ua->send_msg("Level=%s ", level);
}

if (run->Priority) {
ua->send_msg("Priority=%d ", run->Priority);
Expand Down Expand Up @@ -556,7 +558,11 @@ static void do_scheduler_status(UAContext *ua)
if (cnt == 0) {
ua->send_msg("%s\n", sched->hdr.name);
}
ua->send_msg(" %s\n", job->name());
if (job->enabled) {
ua->send_msg(" %s\n", job->name());
} else {
ua->send_msg(" %s (disabled)\n", job->name());
}
cnt++;
}
}
Expand All @@ -567,7 +573,7 @@ static void do_scheduler_status(UAContext *ua)

ua->send_msg("====\n\n");
ua->send_msg("Scheduler Preview for %d days:\n\n", days);
ua->send_msg("Date Schedule Overrides\n");
ua->send_msg("Date Schedule Overrides\n");
ua->send_msg("==============================================================\n");

while (time_to_check < (now + (days * seconds_per_day))) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/btime.c
Expand Up @@ -87,7 +87,7 @@ char *bstrftime_wd(char *dt, int maxlen, utime_t utime)

/* ***FIXME**** the format and localtime_r() should be user configurable */
(void)localtime_r(&time, &tm);
strftime(dt, maxlen, "%a %d-%b %H:%M", &tm);
strftime(dt, maxlen, "%a %d-%b-%Y %H:%M", &tm);
return dt;
}

Expand Down

0 comments on commit 3b3d00c

Please sign in to comment.