]> git.pld-linux.org Git - packages/logrotate.git/blame - logrotate.cron
setup own cronjob instead of fixed cron.daily
[packages/logrotate.git] / logrotate.cron
CommitLineData
715253b2 1#!/bin/sh
715253b2
ER
2MAILTO=""
3ARG=""
4
5if [ -e /etc/sysconfig/logrotate ]; then
6 . /etc/sysconfig/logrotate
7fi
8
287810e7
ER
9# NOTE: DISABLE_LOGROTATE_CRON is not official option to tune, it's only here to handle migration from < 3.8.6-1
10[ "$DISABLE_LOGROTATE_CRON" = "yes" ] && exit 0
11
715253b2
ER
12/usr/sbin/logrotate $ARG /etc/logrotate.conf
13EXITVALUE=$?
14if [ $EXITVALUE != 0 ]; then
15 /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
16 if [ -n "$MAILTO" ]; then
17 echo "ALERT exited abnormally with [$EXITVALUE]" | mail -s "logrotate exited abnormally" $MAILTO
18 fi
19fi
20exit 0
This page took 0.03234 seconds and 4 git commands to generate.