diff --git a/host/config.yaml b/host/config.yaml new file mode 100644 index 0000000..307f1fa --- /dev/null +++ b/host/config.yaml @@ -0,0 +1,16 @@ +debug: false +port: 8123 +listeners: + /startbackup: + command: bash + args: + - -c + - "cd /root/qvalet; ./start_backup.sh" + return: output + + /stopbackup: + command: bash + args: + - -c + - "cd /root/qvalet; ./stop_backup.sh" + return: output diff --git a/host/start_backup.sh b/host/start_backup.sh new file mode 100644 index 0000000..62fc60d --- /dev/null +++ b/host/start_backup.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +value=$( backups_amount +qm start 103 +qm list | grep 103 | awk '{print $3}' diff --git a/host/stop_backup.sh b/host/stop_backup.sh new file mode 100644 index 0000000..89181ae --- /dev/null +++ b/host/stop_backup.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +value=$( 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