add backup:days as zfs value

This commit is contained in:
Jochen Welzel 2021-01-07 13:14:44 +01:00
parent 4e4358e517
commit c2f41aa4e4

View File

@ -31,18 +31,19 @@ then
helpFunction
fi
echo "$(date +%Y-%m-%d_%H:%M:%S): Starting Backup of $VM"
DAYS=$(zfs get backup:days -H -o value $SRCZFS)
if [[ $DAYS == "-" ]]
then
DAYS=7
fi
echo "$(date +%Y-%m-%d_%H:%M:%S): Keeping backups for $DAYS days"
DAYS=$(($DAYS + 1))
DATE=$(date "+%Y%m%d%H%M")
DATEOLD=$(date -d -"$DAYS"day "+%Y%m%d")
SNAPNAME="backup_$DATE"
echo "$(date +%Y-%m-%d_%H:%M:%S): Starting Backup of $VM"
abortFunction()
{