aboutsummaryrefslogtreecommitdiff
path: root/kolla/docker/cron/logrotate
diff options
context:
space:
mode:
Diffstat (limited to 'kolla/docker/cron/logrotate')
-rwxr-xr-xkolla/docker/cron/logrotate18
1 files changed, 18 insertions, 0 deletions
diff --git a/kolla/docker/cron/logrotate b/kolla/docker/cron/logrotate
new file mode 100755
index 000000000..1ac157001
--- /dev/null
+++ b/kolla/docker/cron/logrotate
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# skip in favour of systemd timer
+if [ -d /run/systemd/system ]; then
+ exit 0
+fi
+
+# this cronjob persists removals (but not purges)
+if [ ! -x /usr/sbin/logrotate ]; then
+ exit 0
+fi
+
+/usr/sbin/logrotate /etc/logrotate.conf
+EXITVALUE=$?
+if [ $EXITVALUE != 0 ]; then
+ /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
+fi
+exit $EXITVALUE