Skip to content

Instantly share code, notes, and snippets.

@identifysun
Last active February 28, 2020 01:54
Show Gist options
  • Save identifysun/a1d42a3a195ae6653b905fce041eadd1 to your computer and use it in GitHub Desktop.
Save identifysun/a1d42a3a195ae6653b905fce041eadd1 to your computer and use it in GitHub Desktop.
Openresty logrotate
/var/log/openresty/*.log {
daily
missingok rotate 52
compress delaycompress
notifempty create 640 nobody trusted
sharedscripts
postrotate
container_name=openresty
openresty_running=$(docker inspect --format="{{ .State.Running }}" $container_name 2> /dev/null)
if [ "$openresty_running" == "true" ]; then
docker kill -s SIGUSR1 $container_name
fi
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment