Files
backup-scripts/host/stop_backup.sh
2026-06-11 22:52:08 +02:00

20 lines
336 B
Bash

#!/bin/bash
value=$(<backups_amount)
newvalue=$((value-1))
if [[ $newvalue -lt 0 ]]
then
newvalue=0
fi
echo $newvalue > backups_amount
if [[ $newvalue -gt 0 ]]
then
echo "A backup is still running"
else
echo "Stopping VM"
qm shutdown 103 --timeout 300
qm list | grep 103 | awk '{print $3}'
fi