From 8fe9fd0ca1ece5dad726427323f4e62e02c7eaa9 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 17 Jun 2013 02:35:41 +0200 Subject: [PATCH] [gunicorn] un logrotate pour gunicorn --- Bundler/gunicorn.xml | 1 + Cfg/etc/logrotate.d/gunicorn/gunicorn | 17 +++++++++++++++++ Cfg/etc/logrotate.d/gunicorn/info.xml | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 Cfg/etc/logrotate.d/gunicorn/gunicorn create mode 100644 Cfg/etc/logrotate.d/gunicorn/info.xml diff --git a/Bundler/gunicorn.xml b/Bundler/gunicorn.xml index 0955ec3..ed327f9 100644 --- a/Bundler/gunicorn.xml +++ b/Bundler/gunicorn.xml @@ -1,3 +1,4 @@ + diff --git a/Cfg/etc/logrotate.d/gunicorn/gunicorn b/Cfg/etc/logrotate.d/gunicorn/gunicorn new file mode 100644 index 0000000..4fb1295 --- /dev/null +++ b/Cfg/etc/logrotate.d/gunicorn/gunicorn @@ -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 +} diff --git a/Cfg/etc/logrotate.d/gunicorn/info.xml b/Cfg/etc/logrotate.d/gunicorn/info.xml new file mode 100644 index 0000000..28fd470 --- /dev/null +++ b/Cfg/etc/logrotate.d/gunicorn/info.xml @@ -0,0 +1,3 @@ + + +