Additional Doc Restructure
All checks were successful
GitOps Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 4s
GitOps Automatic Documentation Deployment / Sync Docs to https://docs.bunny-lab.io (push) Successful in 6s

This commit is contained in:
2026-01-27 05:57:50 -07:00
parent e73bb0376f
commit 886fd0db07
78 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
## Purpose
This script is ran via cronjob on `cluster-node-02` at midnight to rollback the deeplab environment automatically to a previous snapshot nightly.
### Bash Script
```sh title="/root/deeplab-rollback.sh"
#!/usr/bin/env bash
# ProxmoxVE Nightly DeepLab Rollback Script
SNAPNAME="ROLLBACK"
DC=140
WIN10=141
WIN11=111
ALL=("$DC" "$WIN10" "$WIN11")
log(){ echo "[$(date '+%F %T')] $*"; }
# Force Stop DeepLab VMs
for id in "${ALL[@]}"; do
log "Force stopping VM $id"
/usr/sbin/qm stop "$id" || true
done
# Rollback Snapshots
for id in "${ALL[@]}"; do
log "Rolling back VM $id to snapshot $SNAPNAME"
/usr/sbin/qm rollback "$id" "$SNAPNAME"
done
# Start DC
log "Starting DC ($DC)"
/usr/sbin/qm start "$DC"
# Wait 2 minutes
log "Waiting 2 minutes for DC to initialize..."
sleep 120
# Start Win10 + Win11
log "Starting WIN10 ($WIN10) and WIN11 ($WIN11)"
/usr/sbin/qm start "$WIN10" &
/usr/sbin/qm start "$WIN11" &
wait
log "Lab Rollback Complete."
```
### Crontab Scheduling
Type `crontab -e` to add an entry to run the job at midnight every day.
=== "With Logging"
``` sh
0 0 * * * /root/deeplab-rollback.sh >> /var/log/deeplab-rollback.log 2>&1
```
=== "Without Logging"
``` sh
0 0 * * * /root/deeplab-rollback.sh 2>&1
```