Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2018-04-22 21:02:03 +1000
committerOlivier Mehani <shtrom@ssji.net>2018-04-22 21:02:03 +1000
commit3032aa845ee039b566a6b5e885dce1e5e0f2696d (patch)
tree809214072ed470dd42c938d30a1bee55a9ad5b3e /openbsd
parentef40366c9864c0ce405395be6124b7f580354f0b (diff)
Add titanium-cleanup.sh
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/titanium-cleanup.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/openbsd/titanium-cleanup.sh b/openbsd/titanium-cleanup.sh
new file mode 100755
index 0000000..108a51b
--- /dev/null
+++ b/openbsd/titanium-cleanup.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# A quick script to delete all but the most recent backup for each app
+# from Titanium Backup
+
+BACKUPPATH=.
+
+PACKAGES=$(ls "${BACKUPPATH}" | sed s/-.*// | sort -u )
+
+for PKG in ${PACKAGES}; do
+ ls -1tr ${PKG}-*.properties | head -n -1 | xargs rm
+ ls -1tr ${PKG}-*.tar.bz2 | head -n -1 | xargs rm
+ ls -1tr ${PKG}-*.apk.* | head -n -1 | xargs rm
+done