Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2020-03-23 13:31:18 +0100
committerOlivier Mehani <shtrom@ssji.net>2020-03-23 13:31:18 +0100
commit29f020c030d797b72e7d57f42dc15c5476539a6d (patch)
tree9c45057023144b4595649192b21858266813d4f5
parent00e24e8e9f2c5d35bbbe79fa950bf84c18d44d17 (diff)
[titanium-cleanup] report count of cleared files
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
-rwxr-xr-xopenbsd/titanium-cleanup.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsd/titanium-cleanup.sh b/openbsd/titanium-cleanup.sh
index cf41db6..602a80c 100755
--- a/openbsd/titanium-cleanup.sh
+++ b/openbsd/titanium-cleanup.sh
@@ -16,9 +16,12 @@ cd ${BACKUPPATH}
PACKAGES=$(ls *.apk.*| sed s/-.*// | sort -u )
+COUNT=0
for PKG in ${PACKAGES}; do
FILES=$(ls -1tr ${PKG}-*.properties 2>/dev/null | sed 1d)
FILES="${FILES:+${FILES} }$(ls -1tr ${PKG}-*.tar.bz2 2>/dev/null | sed 1d)"
FILES="${FILES:+${FILES} }$(ls -1tr ${PKG}-*.apk.* 2>/dev/null | sed 1d)"
test -n "${FILES}" && rm ${FILES}
+ COUNT=$((COUNT + $(echo ${FILES} | wc -w)))
done
+test ${COUNT} -gt 0 && echo "Cleared ${COUNT} files from ${BACKUPPATH}"