]> git.sur5r.net Git - bacula/bacula/commitdiff
Add optional type= argument to .jobs command. You can list only Backup, Restore,...
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 13 Nov 2009 13:25:02 +0000 (14:25 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 13 Nov 2009 13:25:02 +0000 (14:25 +0100)
bacula/src/dird/ua_dotcmds.c

index ef777e207825e1c9c55ce10e1057e39717774c42..0668c97b2c3258f43fcd48dd01c9df7ebb6503ee 100644 (file)
@@ -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();