Skip to content

Commit

Permalink
Merge pull request #489 from onaio/logrotate-celery
Browse files Browse the repository at this point in the history
logrotate celery config
  • Loading branch information
pld committed Aug 18, 2014
2 parents ac88a92 + f93a0b3 commit 36586e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions extras/celeryd/etc/logrotate.d/celeryd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/var/log/celery/*.log {
daily
size 30M
missingok
rotate 52
compress
delaycompress
create 666 ubuntu ubuntu
notifempty
copytruncate
}

10 changes: 9 additions & 1 deletion fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from subprocess import check_call
import sys

from fabric.api import cd, env, prefix, run
from fabric.api import cd, env, prefix, run, sudo
from fabric.contrib import files
from fabric.operations import put

Expand Down Expand Up @@ -169,3 +169,11 @@ def update_xforms(deployment_name, username, path):
finally:
run('rm -r /tmp/%s /tmp/%s.tgz' % (dir_name, dir_name))
check_call(['rm', path_compressed])


def deploy_logrotate_celery(deployment_name, branch='master'):
setup_env(deployment_name)
with cd(env.code_src):
run("git fetch origin")
run("git checkout origin/%s" % branch)
sudo("cp extras/celeryd/etc/logrotate.d/celeryd /etc/logrotate.d/")

0 comments on commit 36586e1

Please sign in to comment.