You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2023/09/29 16:25:30 UTC
[airavata] branch master updated: Ansible: tus upload directory cleanup script
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new 1b1d9c9b57 Ansible: tus upload directory cleanup script
1b1d9c9b57 is described below
commit 1b1d9c9b57cb5f80fef4896a74cd20f1f6007bab
Author: Marcus Christie <ma...@gmail.com>
AuthorDate: Thu Sep 28 18:21:35 2023 -0400
Ansible: tus upload directory cleanup script
---
dev-tools/ansible/roles/tusd/tasks/main.yml | 8 ++++++++
.../ansible/roles/tusd/templates/tus-temp-dir-cleanup.cron.j2 | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/dev-tools/ansible/roles/tusd/tasks/main.yml b/dev-tools/ansible/roles/tusd/tasks/main.yml
index 7655525e86..2d4d7afdeb 100644
--- a/dev-tools/ansible/roles/tusd/tasks/main.yml
+++ b/dev-tools/ansible/roles/tusd/tasks/main.yml
@@ -129,6 +129,14 @@
backup: yes
become: yes
+- name: copy clean up cron job to /etc/cron.daily
+ template:
+ src: "tus-temp-dir-cleanup.cron.j2"
+ dest: /etc/cron.daily/tus-temp-dir-cleanup.cron
+ mode: 0755
+ become: yes
+ become_user: root
+
- name: start tusd
service:
name: tus
diff --git a/dev-tools/ansible/roles/tusd/templates/tus-temp-dir-cleanup.cron.j2 b/dev-tools/ansible/roles/tusd/templates/tus-temp-dir-cleanup.cron.j2
new file mode 100644
index 0000000000..5c6240f0db
--- /dev/null
+++ b/dev-tools/ansible/roles/tusd/templates/tus-temp-dir-cleanup.cron.j2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# Delete files that are older than 7 days
+find {{ tusd_upload_dir }} -mtime +7 -exec rm -rf {} \;