From 70a03528ea63f78a9c2ba53be33df67f16777ea3 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Fri, 9 Sep 2016 12:07:34 +0200 Subject: [PATCH] force logrotate on boot or purge /var/log --- master/etc/rc.local | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 master/etc/rc.local diff --git a/master/etc/rc.local b/master/etc/rc.local new file mode 100644 index 0000000..9dcf833 --- /dev/null +++ b/master/etc/rc.local @@ -0,0 +1,17 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +# clean /var/log +/usr/sbin/logrotate /etc/logrotate.conf --force || { find /var/log/ -type f -exec rm {} \;; reboot; } + +exit 0 -- 2.30.2