From 8e7893856417ab205fdbb574367dd60b554c0690 Mon Sep 17 00:00:00 2001 From: cig Date: Fri, 7 Oct 2022 17:50:41 +0200 Subject: [PATCH] lower retention because of disk space --- vmbackup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmbackup.sh b/vmbackup.sh index f2438f7..afc8c24 100755 --- a/vmbackup.sh +++ b/vmbackup.sh @@ -4,6 +4,7 @@ set -e set -u set -o pipefail +retention=2 statusfile=/var/run/zabbix/vmbackup.status basedir=/mnt/backups/vms vbm="sudo -u cig vboxmanage" @@ -52,7 +53,7 @@ if ( checkRunning $machine ) ; then ret=$? test $ret -eq 0 || _mail "rsync error $ret" $vbm startvm $machine - test $ret -eq 0 && find ${basedir} -maxdepth 1 -type d -mtime +7 -exec echo rm -fr {} \; + test $ret -eq 0 && find ${basedir} -maxdepth 1 -type d -mtime +${retention} -exec echo rm -fr {} \; umount /mnt/backups &> /dev/null || _mail "umount failed" _mail "backup done with status $ret" _exit "backup done" $ret