Skip to content

Instantly share code, notes, and snippets.

@gokure
Last active December 31, 2021 09:17
Show Gist options
  • Save gokure/a074fa4c73c37bb3f6f03938f78a2c98 to your computer and use it in GitHub Desktop.
Save gokure/a074fa4c73c37bb3f6f03938f78a2c98 to your computer and use it in GitHub Desktop.
logrotate example files, put files into /etc/logrotate.d/ directories.
/usr/local/openresty/nginx/logs/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
sharedscripts
postrotate
[ -e /usr/local/openresty/nginx/logs/nginx.pid ] && kill -USR1 `cat /usr/local/openresty/nginx/nginx.pid`
endscript
}
/var/log/php-fpm/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/kill -SIGUSR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment