From 1ea38d7342affd3a111ad708224142dda69f391e Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 18 Jan 2023 01:21:04 +0100 Subject: [PATCH] Plan borg: updates (step). --- Plan Borg/bin/countbackups | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 Plan Borg/bin/countbackups diff --git a/Plan Borg/bin/countbackups b/Plan Borg/bin/countbackups new file mode 100755 index 0000000..0a77cdb --- /dev/null +++ b/Plan Borg/bin/countbackups @@ -0,0 +1,14 @@ +#!/bin/bash + +SCRIPT_NAME="$(basename "$0")" + +BORG_REPOS="/var/backups/borg/" +cd $BORG_REPOS +for BORG_REPO in $(ls -d *.repo); do + if [ -d "$BORG_REPO" ]; then + #echo "$BORG_REPO" + COMPUTER=$(printf "%-40s" ${BORG_REPO::-5}) + OUTPUT=$(borg list "$BORG_REPO" | awk '{ print $1}' | wc -l) + echo "$COMPUTER $OUTPUT" + fi +done