Add logrotate cron job & configuration for OpenShift

This commit is contained in:
Peng Bai 2017-08-04 13:16:25 -05:00
parent a569d3ffb8
commit 597a3ef2cb
2 changed files with 21 additions and 0 deletions

11
.openshift/cron/daily/logrotate Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
pushd $OPENSHIFT_REPO_DIR
/usr/sbin/logrotate -s log/logrotate.status .openshift/logrotate
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
echo "ALERT exited abnormally with [$EXITVALUE]" | /usr/bin/logshifter -tag logrotate
fi
exit 0

10
.openshift/logrotate Normal file
View file

@ -0,0 +1,10 @@
"log/*.log" {
compress
copytruncate
create
dateext
maxage 30
missingok
rotate 4
size 2
}