Skip to content

Commit

Permalink
Add cron job to prune MEDIA_ROOT files
Browse files Browse the repository at this point in the history
Runs daily at 12:05AM to remove media files more than 1 day old
  • Loading branch information
amplifi committed Sep 30, 2016
1 parent 36c9bc2 commit 8767d43
Showing 1 changed file with 7 additions and 0 deletions.
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 @@ -67,6 +67,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

0 comments on commit 8767d43

Please sign in to comment.