From 5be6d3de18a01678ec1a63c53f087e077c2f4b30 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 29 Oct 2017 12:37:29 +0100 Subject: [PATCH] Fix bug #2338 to not truncate already truncated volumes --- bacula/src/dird/ua_purge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 14a04bb28e..5bffaeb6fa 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -676,18 +676,18 @@ int truncate_cmd(UAContext *ua, const char *cmd) if (find_arg(ua, "cache") > 0) { return cloud_volumes_cmd(ua, cmd, "truncate cache"); } - + memset(&pr, 0, sizeof(pr)); /* * Look for all Purged volumes that can be recycled, are enabled and - * have more the 10,000 bytes. + * have more than 1,000 bytes (i.e. actually have data). */ mr.Recycle = 1; mr.Enabled = 1; - mr.VolBytes = 200; + mr.VolBytes = 1000; bstrncpy(mr.VolStatus, "Purged", sizeof(mr.VolStatus)); - + /* Get list of volumes to truncate */ if (!scan_storage_cmd(ua, cmd, true, /* allfrompool */ &drive, &mr, &pr, &action, storage, &nb, &results)) { goto bail_out; -- 2.39.5