26 lines
475 B
Bash
Executable File
26 lines
475 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "# Configuring logrotate"
|
|
|
|
# make sure path exists
|
|
mkdir -p "${PATH_LOGS}"
|
|
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_LOGS}"
|
|
|
|
# configure logrotate
|
|
cat >/etc/logrotate.d/nginx <<EOF
|
|
${PATH_LOGS}/nginx-access.log {
|
|
missingok
|
|
daily
|
|
rotate ${LOG_DAYS}
|
|
compress
|
|
delaycompress
|
|
sharedscripts
|
|
nodateext
|
|
su ${USERNAME} ${GROUPNAME}
|
|
postrotate
|
|
/usr/sbin/nginx -s reopen
|
|
nice -n 19 /app/stats.sh
|
|
endscript
|
|
}
|
|
EOF
|