Last active
February 28, 2020 01:54
-
-
Save identifysun/a1d42a3a195ae6653b905fce041eadd1 to your computer and use it in GitHub Desktop.
Openresty logrotate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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