From 2419c5ad32c759da9a06ba64213964e228b20f03 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 10 Aug 2017 13:16:38 +0100 Subject: [PATCH] Shorten time for expiring gnusocial files --- src/freedombone-utils-gnusocialtools | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index ecd667d2..ea01839e 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -741,6 +741,9 @@ function expire_gnusocial_posts { expire_days=$((expire_months * 30)) + # files are what take up most of the backup time, so don't keep them for very long + expire_days_files=7 + # To prevent the database size from growing endlessly this script expires posts # after a number of months if [ ! -d /var/www/${domain_name}/htdocs ]; then @@ -790,7 +793,7 @@ function expire_gnusocial_posts { gnusocial_expire_script=/usr/bin/${gnusocial_type}-expire echo '#!/bin/bash' > $gnusocial_expire_script - echo "find /var/www/${domain_name}/htdocs/file/* -mtime +${expire_days} -exec rm {} +" >> $gnusocial_expire_script + echo "find /var/www/${domain_name}/htdocs/file/* -mtime +${expire_days_files} -exec rm {} +" >> $gnusocial_expire_script echo "/usr/bin/php $gnusocial_expire_posts_script" >> $gnusocial_expire_script chmod +x $gnusocial_expire_script