force logrotate on boot or purge /var/log
authorLaurent Mazet <laurent.mazet@thalesgroup.com>
Fri, 9 Sep 2016 10:07:34 +0000 (12:07 +0200)
committerLaurent Mazet <laurent.mazet@thalesgroup.com>
Fri, 9 Sep 2016 10:07:34 +0000 (12:07 +0200)
master/etc/rc.local [new file with mode: 0644]

diff --git a/master/etc/rc.local b/master/etc/rc.local
new file mode 100644 (file)
index 0000000..9dcf833
--- /dev/null
@@ -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