aboutsummaryrefslogtreecommitdiffstats
path: root/main/logrotate/logrotate.cron
diff options
context:
space:
mode:
Diffstat (limited to 'main/logrotate/logrotate.cron')
-rw-r--r--main/logrotate/logrotate.cron16
1 files changed, 16 insertions, 0 deletions
diff --git a/main/logrotate/logrotate.cron b/main/logrotate/logrotate.cron
new file mode 100644
index 0000000000..ad7b3da1a3
--- /dev/null
+++ b/main/logrotate/logrotate.cron
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ -f /etc/conf.d/logrotate ]; then
+ . /etc/conf.d/logrotate
+fi
+
+if [ -x /usr/bin/cpulimit ] && [ -n "$CPULIMIT" ]; then
+ _cpulimit="/usr/bin/cpulimit --limit=$CPULIMIT"
+fi
+
+$_cpulimit /usr/sbin/logrotate /etc/logrotate.conf
+EXITVALUE=$?
+if [ $EXITVALUE != 0 ]; then
+ /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
+fi
+exit 0