From: Eric Bollengier Date: Fri, 13 Nov 2009 13:25:02 +0000 (+0100) Subject: Add optional type= argument to .jobs command. You can list only Backup, Restore,... X-Git-Tag: Release-5.0.0~246^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a846aeb3b87fc11e906a521ca232cd57e82ef088;p=bacula%2Fbacula Add optional type= argument to .jobs command. You can list only Backup, Restore,... jobs. --- diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index ef777e2078..0668c97b2c 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -511,13 +511,24 @@ static bool diecmd(UAContext *ua, const char *cmd) #endif +/* + * Can use an argument to filter on JobType + * .jobs [type=B] + */ static bool jobscmd(UAContext *ua, const char *cmd) { JOB *job; + uint32_t type = 0; + int pos; + if ((pos = find_arg_with_value(ua, "type")) >= 0) { + type = ua->argv[pos][0]; + } LockRes(); foreach_res(job, R_JOB) { - if (acl_access_ok(ua, Job_ACL, job->name())) { - ua->send_msg("%s\n", job->name()); + if (!type || type == job->JobType) { + if (acl_access_ok(ua, Job_ACL, job->name())) { + ua->send_msg("%s\n", job->name()); + } } } UnlockRes();