From 735b888fcb8ffe59582529db099456a213429f30 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Tue, 7 Oct 2008 21:41:33 +0200 Subject: [PATCH] logfiles only keep 60 days of cron logfiles on disc Signed-off-by: Joerg Jaspert --- ChangeLog | 5 +++++ config/debian/cron.dinstall | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 288c7708..519c6c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-07 Joerg Jaspert + + * config/debian/cron.dinstall: Only keep the last 60 days of + dinstall logfiles on disc. + 2008-09-23 Joerg Jaspert * config/debian/dak.conf: Add the validtime fields, set to 7 diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index de44fe5f..cb326fc6 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -338,6 +338,21 @@ echo "Compress old psql backups" ts +echo "Removing old dinstall logfiles" +(cd $logdir + find -maxdepth 1 -mindepth 1 -type f -name 'dinstall_*' -mtime +60 | + while read dumpname; do + echo "Removing $dumpname" + rm -f "$dumpname" + done + + find -maxdepth 1 -mindepth 1 -type f -name 'weekly_*' -mtime +60 | + while read dumpname; do + echo "Removing $dumpname" + rm -f "$dumpname" + done +) + echo "Finally, all is done, sending mail and compressing logfile" exec > /dev/null 2>&1 -- 2.39.2