[gunicorn] un logrotate pour gunicorn

This commit is contained in:
Valentin Samir 2013-06-17 02:35:41 +02:00
parent 3fee4bb662
commit 8fe9fd0ca1
3 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,4 @@
<Bundle name="gunicorn">
<Package name="gunicorn"/>
<Path name="/etc/logrotate.d/gunicorn"/>
</Bundle>

View 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
}

View file

@ -0,0 +1,3 @@
<FileInfo>
<Info owner='root' group='root' perms='0644'/>
</FileInfo>