Files
Scripts/ProxmoxTimedShutdown.sh
Dunestorm 2029eb40bc [Proxmox Timed Shutdown]
- Backup query has been moved after sleep function to prevent bogus results.
2022-06-29 22:57:28 +01:00

12 lines
316 B
Bash

#!/bin/bash
echo "Waiting 1hr to allow user to cancel shutdown"
sleep 1h
if [ `ps -ef | grep vzdump | wc -l` -eq 1 ]; then
echo "Triggering scheduled post-backup shutdown"
/usr/sbin/shutdown -h now
else
echo "Automatic shutdown not triggered due to concurrent backup task"
exit 2
fi