From 258f472f06b277da7abb9802c46f25ee6b6e9db0 Mon Sep 17 00:00:00 2001 From: neingeist Date: Fri, 2 Jul 2021 15:57:07 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20apt-dater-history-prune:=20prune=20?= =?UTF-8?q?old=20apt-dater=20history=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-dater-history-prune | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 apt-dater-history-prune diff --git a/apt-dater-history-prune b/apt-dater-history-prune new file mode 100755 index 0000000..e1013df --- /dev/null +++ b/apt-dater-history-prune @@ -0,0 +1,9 @@ +#!/bin/sh +# Prune old apt-dater history +MTIME=+365 + +find ~/.local/share/apt-dater/history -name meta -mtime $MTIME -exec dirname {} \; | while read history_dir; do + # We are too squeamish to just use rm -rf + rm -f "$history_dir"/{command,meta,timingfile,typescript,failed} + rmdir "$history_dir" +done