]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/autoprune.c
ebl Try to fix bug on RunScript {} resource parsing
[bacula/bacula] / bacula / src / dird / autoprune.c
index e0214080d93d2f46c993b1d90c8b18bc7ed70666..0fea7f8a7608e6dd4e2e4eb2558fb1f332844250 100644 (file)
  * Auto Prune Jobs and Files. This is called at the end of every
  *   Job.  We do not prune volumes here.
  */
-int do_autoprune(JCR *jcr)
+void do_autoprune(JCR *jcr)
 {
    UAContext *ua;
    CLIENT *client;
    bool pruned;
 
    if (!jcr->client) {                /* temp -- remove me */
-      return 1;
+      return;
    }
 
    ua = new_ua_context(jcr);
@@ -71,7 +71,7 @@ int do_autoprune(JCR *jcr)
    }
 
    free_ua_context(ua);
-   return 1;
+   return;
 }
 
 /*
@@ -117,6 +117,10 @@ int prune_volumes(JCR *jcr)
       if (jcr->jr.PoolId != mr.PoolId) {
          continue;
       }
+      /* Don't prune archived volumes */
+      if (mr.Enabled == 2) {
+         continue;
+      }
       /* Prune only Volumes with status "Full", or "Used" */
       if (strcmp(mr.VolStatus, "Full")   == 0 ||
           strcmp(mr.VolStatus, "Used")   == 0) {