From 5c3202b303883370de62399d84987cd3e6761e5b Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 28 Jul 2014 08:36:04 +0200 Subject: [PATCH] Fix #547 by adding .schedule command --- bacula/src/dird/ua_dotcmds.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; -- 2.39.2