Add cron templates
This commit is contained in:
parent
f2b861c7a7
commit
52ab8469f7
1 changed files with 17 additions and 0 deletions
17
deploy/cron/cron.daily
Normal file
17
deploy/cron/cron.daily
Normal 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:
|
Loading…
Reference in a new issue