Use cronic to make cron jobs less noisy

This commit is contained in:
Ben Sturmfels 2023-05-06 16:41:30 +10:00
parent d11767cbf4
commit 50cfcb7683
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
2 changed files with 3 additions and 3 deletions

View file

@ -7,9 +7,9 @@ source {{ env.project_dir }}/env
# PYTHONPATH variable is not preserved by sudo.
# Clear out expired Django sessions.
sudo --user={{ env.app_user }} --preserve-env PYTHONPATH={{ env.project_dir }}:$PYTHONPATH {{ env.virtualenv }}/bin/django-admin clearsessions
cronic sudo --user={{ env.app_user }} --preserve-env PYTHONPATH={{ env.project_dir }}:$PYTHONPATH {{ env.virtualenv }}/bin/django-admin clearsessions
sudo --user={{ env.app_user }} --preserve-env PYTHONPATH={{ env.project_dir }}:$PYTHONPATH {{ env.virtualenv }}/bin/django-admin expunge_deleted
cronic sudo --user={{ env.app_user }} --preserve-env PYTHONPATH={{ env.project_dir }}:$PYTHONPATH {{ env.virtualenv }}/bin/django-admin expunge_deleted
# Local Variables:

2
fabfile.py vendored
View file

@ -19,7 +19,7 @@ hosts = os.environ['FABRIC_HOSTS'].split(',')
def install_essentials(c):
# ImageMagick (convert) and Inkscape required for generating badges.
c.run('sudo apt-get install -yy git python3-dev python3-venv python3-wheel build-essential python3-cairocffi python3-psycopg2 postgresql uwsgi-emperor uwsgi-plugin-python3 memcached netcat nginx certbot libmemcached-dev xmlsec1 imagemagick inkscape')
c.run('sudo apt-get install -yy git python3-dev python3-venv python3-wheel build-essential python3-cairocffi python3-psycopg2 postgresql uwsgi-emperor uwsgi-plugin-python3 memcached netcat nginx certbot libmemcached-dev xmlsec1 imagemagick inkscape cronic')
@task(hosts=hosts)