[dak/security] logfiles
only keep 60 days of cron logfiles on disc
Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
ChangeLog | 5 +++++
config/debian/cron.dinstall | 15 +++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 288c770..519c6c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-07 Joerg Jaspert <joerg@debian.org>
+
+ * config/debian/cron.dinstall: Only keep the last 60 days of
+ dinstall logfiles on disc.
+
2008-09-23 Joerg Jaspert <joerg@debian.org>
* config/debian/dak.conf: Add the validtime fields, set to 7
diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall
index de44fe5..cb326fc 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
--
1.5.6.5
Reply to: