From: Eric Bollengier Date: Mon, 28 Jul 2014 06:36:04 +0000 (+0200) Subject: Fix #547 by adding .schedule command X-Git-Tag: Release-7.0.5~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c3202b303883370de62399d84987cd3e6761e5b;p=bacula%2Fbacula Fix #547 by adding .schedule command --- diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 278ea414f7..a764d7dc2f 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -48,6 +48,7 @@ static bool filesetscmd(UAContext *ua, const char *cmd); static bool clientscmd(UAContext *ua, const char *cmd); static bool msgscmd(UAContext *ua, const char *cmd); static bool poolscmd(UAContext *ua, const char *cmd); +static bool schedulescmd(UAContext *ua, const char *cmd); static bool storagecmd(UAContext *ua, const char *cmd); static bool defaultscmd(UAContext *ua, const char *cmd); static bool typescmd(UAContext *ua, const char *cmd); @@ -98,6 +99,7 @@ static struct cmdstruct commands[] = { /* help */ /* can be used in runscript * { NT_(".pools"), poolscmd, NULL, true}, { NT_(".quit"), dot_quit_cmd, NULL, false}, { NT_(".putfile"), putfile_cmd, NULL, false}, /* use @putfile */ + { NT_(".schedule"), schedulescmd, NULL, false}, { NT_(".sql"), sql_cmd, NULL, false}, { NT_(".status"), dot_status_cmd, NULL, false}, { NT_(".storage"), storagecmd, NULL, true}, @@ -1158,6 +1160,19 @@ static bool poolscmd(UAContext *ua, const char *cmd) return true; } +static bool schedulescmd(UAContext *ua, const char *cmd) +{ + SCHED *sched; + LockRes(); + foreach_res(sched, R_SCHEDULE) { + if (acl_access_ok(ua, Schedule_ACL, sched->name())) { + ua->send_msg("%s\n", sched->name()); + } + } + UnlockRes(); + return true; +} + static bool storagecmd(UAContext *ua, const char *cmd) { STORE *store;