From fec1956dc68cd6e6abdebc96bac522a04d7fe50c Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 13 Nov 2009 14:25:02 +0100 Subject: [PATCH] Add optional type= argument to .jobs command. You can list only Backup, Restore,... jobs. --- bacula/src/dird/ua_dotcmds.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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(); -- 2.39.5