lower retention because of disk space

This commit is contained in:
cig
2022-10-07 17:50:41 +02:00
committed by root
parent 099ad06a81
commit 8e78938564

View File

@@ -4,6 +4,7 @@ set -e
set -u set -u
set -o pipefail set -o pipefail
retention=2
statusfile=/var/run/zabbix/vmbackup.status statusfile=/var/run/zabbix/vmbackup.status
basedir=/mnt/backups/vms basedir=/mnt/backups/vms
vbm="sudo -u cig vboxmanage" vbm="sudo -u cig vboxmanage"
@@ -52,7 +53,7 @@ if ( checkRunning $machine ) ; then
ret=$? ret=$?
test $ret -eq 0 || _mail "rsync error $ret" test $ret -eq 0 || _mail "rsync error $ret"
$vbm startvm $machine $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" umount /mnt/backups &> /dev/null || _mail "umount failed"
_mail "backup done with status $ret" _mail "backup done with status $ret"
_exit "backup done" $ret _exit "backup done" $ret