]>
Commit | Line | Data |
---|---|---|
715253b2 | 1 | #!/bin/sh |
715253b2 ER |
2 | MAILTO="" |
3 | ARG="" | |
4 | ||
5 | if [ -e /etc/sysconfig/logrotate ]; then | |
6 | . /etc/sysconfig/logrotate | |
7 | fi | |
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 |
13 | EXITVALUE=$? | |
14 | if [ $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 | |
19 | fi | |
20 | exit 0 |