Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/#354 Cron task to prune MEDIA_ROOT files #752

Merged
merged 2 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions provision/roles/webserver/production/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
src="{{ application_path }}app/dist"
state=link

- name: Create cron job to prune MEDIA_ROOT files
become: yes
become_user: root
cron: name="prune django media files" minute=5 hour=0
user="root"
job="find {{ application_path }}cadasta/media/s3/* -type f -ctime +1 -exec rm {} \\; > /var/log/django/prune_media.log"

- name: Copy uwsgi_params to base directory
become: yes
become_user: "{{ app_user }}"
Expand Down
2 changes: 1 addition & 1 deletion provision/roles/webserver/production/templates/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chmod-socket = 666
vacuum = true

pidfile = /tmp/cadasta-master.pid
harakiri = 20
harakiri = 60
max-requests = 5000
daemonize = /var/log/uwsgi/cadasta.log

Expand Down