nginx: Rename nginx/server to nginx
This commit is contained in:
parent
2119f96382
commit
4fb04065f9
22 changed files with 16 additions and 16 deletions
25
roles/nginx/templates/nginx-logrotate.sh
Executable file
25
roles/nginx/templates/nginx-logrotate.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
umask 022
|
||||
|
||||
[ -f /var/run/nginx.pid ] || exit 0
|
||||
|
||||
SUFFIX="$(date +%Y%m%d-%H%M%S)"
|
||||
LOGS=""
|
||||
|
||||
for log in "{{ nginx_logdir }}"/*.log ; do
|
||||
[ -s "$log" ] || continue
|
||||
mv "$log" "${log}.${SUFFIX}"
|
||||
LOGS="${LOGS} ${log}.${SUFFIX}"
|
||||
done
|
||||
|
||||
[ -z "$LOGS" ] && exit 0
|
||||
|
||||
kill -USR1 "$(cat /var/run/nginx.pid)"
|
||||
sleep 5
|
||||
|
||||
for log in $LOGS ; do
|
||||
gzip "$log"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue