Skip to content

Instantly share code, notes, and snippets.

@agseco
Created May 28, 2018 10:13
Show Gist options
  • Save agseco/2e688281b75472ad80423baa55149bc0 to your computer and use it in GitHub Desktop.
Save agseco/2e688281b75472ad80423baa55149bc0 to your computer and use it in GitHub Desktop.
Logrotate - Configuration to rotate hourly

/etc/cron.hourly/logrotate

#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.hourly.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

/etc/logrotate.hourly.conf

/var/log/basis-grid/basis-debug.log {
    size 1G
    maxage 7
    notifempty
    dateext
    compress
    copytruncate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment