From: Eric Bollengier Date: Fri, 24 Apr 2020 15:44:53 +0000 (+0200) Subject: BEE Backport bacula/src/dird/autoprune.c X-Git-Tag: Release-11.3.2~1769 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f359afe32ac7474cea17c4f457e94765a41b4e2;p=thirdparty%2Fbacula.git BEE Backport bacula/src/dird/autoprune.c This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Fri May 17 16:58:03 2019 +0200 Fix #5057 Block prune_volumes() with Director::Autoprune directive Author: Eric Bollengier Date: Fri Dec 21 10:11:06 2018 +0100 Add Director:Autoprune directive to control globally the autoprune feature --- diff --git a/bacula/src/dird/autoprune.c b/bacula/src/dird/autoprune.c index 6e7f9e4797..4de567fe9a 100644 --- a/bacula/src/dird/autoprune.c +++ b/bacula/src/dird/autoprune.c @@ -41,6 +41,11 @@ void do_autoprune(JCR *jcr) POOL *pool; bool pruned; + if (!director->AutoPrune) { + Dmsg0(100, "AutoPrune globally switched off\n"); + return; + } + if (!jcr->client) { /* temp -- remove me */ return; } @@ -86,9 +91,14 @@ void prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr, POOL_DBR spr; + if (!director->AutoPrune) { + Dmsg0(100, "AutoPrune globally switched off\n"); + return; + } + Dmsg1(100, "Prune volumes PoolId=%d\n", jcr->jr.PoolId); if (!jcr->job->PruneVolumes && !jcr->pool->AutoPrune) { - Dmsg0(100, "AutoPrune not set in Pool.\n"); + Dmsg0(100, "AutoPrune not set in Pool or Job.\n"); return; }