diff options
author | Olivier Mehani <shtrom@ssji.net> | 2018-04-22 21:02:03 +1000 |
---|---|---|
committer | Olivier Mehani <shtrom@ssji.net> | 2018-04-22 21:02:03 +1000 |
commit | 3032aa845ee039b566a6b5e885dce1e5e0f2696d (patch) | |
tree | 809214072ed470dd42c938d30a1bee55a9ad5b3e | |
parent | ef40366c9864c0ce405395be6124b7f580354f0b (diff) |
Add titanium-cleanup.sh
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
-rwxr-xr-x | openbsd/titanium-cleanup.sh | 13 |
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 |