Planned Shutdown¶
This document describes how to shut down the homelab cleanly before a planned power outage, when moving the Beelink, or before vacation.
It supports:
- manual execution
- one-time scheduled execution
Script¶
Store the script on the Proxmox host at:
text
/root/scripts/shutdown-homelab.sh
Make it executable:
bash
chmod +x /root/scripts/shutdown-homelab.sh
What the script does¶
Shutdown order:
- VM 100 – Home Assistant
- CT 105 – Cloudflared
- CT 103 – Paperless
- CT 101 – Docker
- CT 102 – AdGuard
- CT 104 – Unbound
- Proxmox host shutdown
The script:
- requests graceful shutdown
- waits 90 seconds by default
- force-stops remaining guests if needed
- shuts down the Proxmox host
Log file:
text
/var/log/shutdown-homelab.log
Manual shutdown¶
Run directly on the Proxmox host:
bash
/root/scripts/shutdown-homelab.sh
Alternative:
bash
bash /root/scripts/shutdown-homelab.sh
One-time planned shutdown¶
Use at for a single scheduled shutdown.
Install at¶
bash
apt update
apt install -y at
systemctl enable --now atd
Schedule a one-time shutdown¶
Example: Thursday at 08:30
bash
echo "/root/scripts/shutdown-homelab.sh" | at 08:30 Thu
Check scheduled jobs¶
bash
atq
Remove a scheduled job¶
bash
atrm <job-id>
Optional: shorter or longer wait time¶
Default wait time before force-stop is 90 seconds.
You can override it manually:
bash
WAIT_SECONDS=120 /root/scripts/shutdown-homelab.sh
Typical use cases¶
- planned power outage
- moving the Beelink to another location
- shutting down the homelab before vacation
- maintenance requiring full power-off
Notes¶
- This is intended for planned shutdown only
- It does not replace a UPS
- For unplanned outages, use a UPS + NUT based shutdown
- After power returns, automatic restart depends on BIOS setting:
Restore on AC Power Loss = Power On
Suggested validation after next boot¶
- Proxmox reachable
- CTs/VMs started correctly
- AdGuard working
- Home Assistant reachable
- external domains reachable again