]> TLD Linux GIT Repositories - packages/logrotate.git/blob - logrotate.cron
- updated to 3.21.0
[packages/logrotate.git] / logrotate.cron
1 #!/bin/sh
2 MAILTO=""
3 ARG=""
4
5 if [ -e /etc/sysconfig/logrotate ]; then
6         . /etc/sysconfig/logrotate
7 fi
8
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
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