opnsense-ports/sysutils/acts/files/patch-acts
Franco Fichtner d9a3ce89d2 */*: sync with upstream
Taken from: HardenedBSD
2019-08-01 12:10:42 +02:00

33 lines
1.4 KiB
Text

From 8230c749dd92ce6d5fd7b742525e8c9701f4bacb Mon Sep 17 00:00:00 2001
From: Adam Weinberger <adamw@adamw.org>
Date: Tue, 16 Jul 2019 06:16:27 -0600
Subject: [PATCH] Wrap the archive deletion tarsnap call
With it unwrapped, if you call tarsnap with --print-stats, or if that
is in your tarsnap.conf, you'll get the stats printed after every
archive deletion.
While the information is great to have, if you have many targets,
you get 5n lines of output, with nothing indicating which target it's
referring to. It might be worth exploring a better way to show how
much data got added and/or removed for each target, given that tarsnap
can automatically give that info right back to acts.
---
acts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/acts b/acts
index 4dc1803..63f35cb 100755
--- acts.orig
+++ acts
@@ -238,7 +238,9 @@ prune_backups() {
log_verbose "message=\"Deleting backup prefix $archiveprefixtodel*\""
echo "$archives" | grep -E "^$archiveprefixtodel" | while read -r archivetodel; do
log_debug "message=\"Deleting backup $archivetodel\""
- $tarsnap -d -f "$archivetodel"
+ if ! output="$($tarsnap -d -f "$archivetodel" 2>&1)"; then
+ log_message "delete-error type=$backuplevel output=\"$(echo $output | tr '\n' " ")\""
+ fi
done
done
else