From 35344f7f6b76745c951a2a03add38229d7c68b46 Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Wed, 8 Jun 2022 10:36:48 +0200 Subject: [PATCH] puppet: Add cronjob to run delete_old_unclaimed_attachments daily. --- .../zulip/files/cron.d/delete-old-unclaimed-attachments | 6 ++++++ puppet/zulip/manifests/app_frontend_once.pp | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 puppet/zulip/files/cron.d/delete-old-unclaimed-attachments diff --git a/puppet/zulip/files/cron.d/delete-old-unclaimed-attachments b/puppet/zulip/files/cron.d/delete-old-unclaimed-attachments new file mode 100644 index 0000000000..7400242460 --- /dev/null +++ b/puppet/zulip/files/cron.d/delete-old-unclaimed-attachments @@ -0,0 +1,6 @@ +SHELL=/bin/bash +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +USER=zulip + +# Daily cronjob for cleaning up old, unclaimed attachments and their corresponding files. +0 6 * * * zulip /home/zulip/deployments/current/manage.py delete_old_unclaimed_attachments -f >/dev/null diff --git a/puppet/zulip/manifests/app_frontend_once.pp b/puppet/zulip/manifests/app_frontend_once.pp index 148015d15e..4d3ba3bb9e 100644 --- a/puppet/zulip/manifests/app_frontend_once.pp +++ b/puppet/zulip/manifests/app_frontend_once.pp @@ -67,6 +67,14 @@ class zulip::app_frontend_once { source => 'puppet:///modules/zulip/cron.d/archive-messages', } + file { '/etc/cron.d/delete-old-unclaimed-attachments': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + source => 'puppet:///modules/zulip/cron.d/delete-old-unclaimed-attachments', + } + file { '/etc/cron.d/clearsessions': ensure => file, owner => 'root',