Add cron templates

This commit is contained in:
Ben Sturmfels 2023-05-02 16:31:09 +10:00
parent f2b861c7a7
commit 52ab8469f7
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

17
deploy/cron/cron.daily Normal file
View file

@ -0,0 +1,17 @@
#!/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.
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
# Local Variables:
# mode: shell-script-mode
# End: