lower retention because of disk space
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user