Skip to content

Instantly share code, notes, and snippets.

@bearlyrunning
Last active April 9, 2018 01:44
Show Gist options
  • Save bearlyrunning/c7c8f459672c93a7e6a1a8843edc010e to your computer and use it in GitHub Desktop.
Save bearlyrunning/c7c8f459672c93a7e6a1a8843edc010e to your computer and use it in GitHub Desktop.
Log Rotation
/var/log/apache2/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 400 root root
sharedscripts
postrotate
if /etc/init.d/apache2 status > /dev/null ; then \
/etc/init.d/apache2 reload > /dev/null; \
fi;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment