Upload files to "/"

This commit is contained in:
2026-09-06 22:38:14 +00:00
parent 8056b6706b
commit 4998e20423
2 changed files with 162 additions and 0 deletions

47
README.md Normal file
View File

@@ -0,0 +1,47 @@
# Wakeupper for Proxmox Backup Server
![CryptoFox](https://data.shupogaki.org/assets/serika-blue-archive.gif)
Program for running scheduled Proxmox Backup Server syncs and also waking up the iDRAC, and possibly ILOM, servers.
It can:
* Power on a PBS server through iDRAC/IPMI
* Wait for the server to become reachable
* Connect to PBS over SSH
* Create a sync job if needed and start it
* Wait for PBS tasks to finish
* Shut down the PBS server when finished
Designed to run in Docker or Kubernetes/CronJob.
## Environment variables
| Variable | Description | Default |
| ---------------------- | ----------------------------------- | --------------------------- |
| `IDRAC` | iDRAC hostname/IP | required |
| `IDRAC_USR` | iDRAC username | required |
| `IDRAC_PWD` | iDRAC password | required |
| `HOST` | PBS hostname/IP | required |
| `HOST_SSH_PORT` | PBS SSH port | required |
| `HOST_USR` | SSH username | `root` |
| `HOST_USR_PWD` | SSH password | optional |
| `HOST_USR_SSHKEY` | SSH private key | optional |
| `HOST_USR_SSHKEY_PASS` | SSH key passphrase | optional |
| `LOCAL_DATASTORE` | Local PBS datastore | required |
| `REMOTE_DATASTORE` | Remote PBS datastore | required |
| `REMOTE_PBS` | Remote PBS hostname/address | required |
| `SYNC_DIR` | Sync direction: `push` or `pull` | `push` |
| `PBS_RATE_OUT` | Push bandwidth limit | optional |
| `PBS_RATE_IN` | Pull bandwidth limit | optional |
| `PBS_TASK_LIMIT` | Number of PBS tasks to inspect | `50` |
| `PBS_MAX_RUNTIME_MIN` | Maximum task runtime | `180` |
| `PBS_MAX_SHUT_MIN` | Time allowed for shutdown | `10` |
| `AUTO_ADD_NAME` | Automatically created sync-job name | `autoBackupScript_one-shot` |
Example Kubernetes configuration is available in `manifest.yaml`, including Secret/ConfigMap values and a scheduled CronJob.

115
Roadmap Normal file
View File

@@ -0,0 +1,115 @@
# Connect to IDRAC
# Check if power is on
# chassis power status | grep fourth element
# "Chassis Power is off"
# if turn on power
# Send Power on (ipmitool chassis power on)
# else systemPower is on, continue.
# Store current date as PWR_DATE to later compare in while loop
# Send ping to HOST every 15 seconds for 10 minutes. It can take some time for the server to start
# while PWR_DATE is less than 15 minutes compared to CURRENT_DATE, ping
# if ping successfull 3 times in a row
# break
# else, exit with error,
# exit "Host didn't start after 20 minutes. Check the server"
# SSH to HOST
# check when verification was last ran
# if not in the last LAST_VERIF_D, run verification
# Verify datastore backups
# else, backups already verified enough, continue
# continue
# check if remote exists
# proxmox-backup-manager remote list
# ┌──────┬──────────────┬──────────┬───────────────────────────────────────────┬─────────┐
# │ name │ host │ userid │ fingerprint │ comment │
# ╞══════╪══════════════╪══════════╪═══════════════════════════════════════════╪═════════╡
# │ pbs2 │ pbs2.example │ sync@pam │64:d3:ff:3a:50:38:53:5a:9b:f7:50:...:ab:fe │ │
# └──────┴──────────────┴──────────┴───────────────────────────────────────────┴─────────┘
# for each remote host in REMOTE_PBS
# if remote host not in "host" collumn from "remote list" command
# exit with "Please first add a remote to PBS"
# else
# print All passed remotes found on PBS
# Get local and remote stores
# Create backup one-shot sync job
# for syncJob in jobList
# if AUTO_ADD_NAME in comment collumn of syncJob
# remove sync-job by id
# elif
# Add sync job
# else
# idk
# run one-shop sync jobs
# for syncJob in jobList
# if AUTO_ADD_NAME in syncJob.comment
# run sync-job
# if run succesfull
# continue
# else
# print the error message to stderr
# elif AUTO_ADD_NAME not in syncJob.comment
# skipping a manually addad syncJob
# else
# either no syncJobs or something broke
# store current date as PWR_OFF_DATE
# while ongoing syncJobs or ongoing verifyJobs
# if any remaining syncJobs and verifyJobs and garbageCollect finish
# if PWR_OFF_DATE is longer than 3 hours
# brake in order to send shutdown signal nontheless
# else
# sleep for 30 seconds
# send power off signal via SSH
# if chassis power status is on after 5 minutes
# send additional "chassis power off" via ipmitool
# else
# exit 0
# proxmox-backup-manager sync-job create pbs2-local --remote pbs2 --remote-store local --store local --schedule 'Wed 02:30'
# proxmox-backup-manager sync-job update pbs2-local --comment 'offsite'
# proxmox-backup-manager sync-job list
# ┌────────────┬───────┬────────┬──────────────┬───────────┬─────────┐
# │ id │ store │ remote │ remote-store │ schedule │ comment │
# ╞════════════╪═══════╪════════╪══════════════╪═══════════╪═════════╡
# │ pbs2-local │ local │ pbs2 │ local │ Wed 02:30 │ offsite │
# └────────────┴───────┴────────┴──────────────┴───────────┴─────────┘
# proxmox-backup-manager sync-job remove pbs2-local