From: Kern Sibbald Date: Sun, 29 Oct 2017 11:37:29 +0000 (+0100) Subject: Fix bug #2338 to not truncate already truncated volumes X-Git-Tag: Release-9.0.5~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5be6d3de18a01678ec1a63c53f087e077c2f4b30;p=bacula%2Fbacula Fix bug #2338 to not truncate already truncated volumes --- 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;