symposion_app/deploy/cron/cron.daily

17 lines
546 B
Bash

#!/bin/bash
export DJANGO_SETTINGS_MODULE={{ env.settings }}
set -a
source {{ env.project_dir }}/env
# PYTHONPATH variable is not preserved by sudo.
# Clear out expired Django sessions.
cronic 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 expunge_deleted
# Local Variables:
# mode: shell-script-mode
# End: