[gunicorn] un logrotate pour gunicorn
This commit is contained in:
parent
3fee4bb662
commit
8fe9fd0ca1
3 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
<Bundle name="gunicorn">
|
<Bundle name="gunicorn">
|
||||||
<Package name="gunicorn"/>
|
<Package name="gunicorn"/>
|
||||||
|
<Path name="/etc/logrotate.d/gunicorn"/>
|
||||||
</Bundle>
|
</Bundle>
|
||||||
|
|
17
Cfg/etc/logrotate.d/gunicorn/gunicorn
Normal file
17
Cfg/etc/logrotate.d/gunicorn/gunicorn
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/var/log/gunicorn/*.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
rotate 52
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
create 0640 www-data adm
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
if [ -e /var/run/gunicorn ] && [ `ls /var/run/gunicorn/ | wc -l` -ge 1 ]; then
|
||||||
|
for i in /var/run/gunicorn/*; do
|
||||||
|
service=`basename $i | sed 's/\.pid//'`
|
||||||
|
/etc/init.d/gunicorn restart $service >/dev/null
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
endscript
|
||||||
|
}
|
3
Cfg/etc/logrotate.d/gunicorn/info.xml
Normal file
3
Cfg/etc/logrotate.d/gunicorn/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner='root' group='root' perms='0644'/>
|
||||||
|
</FileInfo>
|
Loading…
Add table
Add a link
Reference in a new issue