reference:scripts
Differences
This shows you the differences between two versions of the page.
| reference:scripts [2026/06/17 14:34] – created - external edit 127.0.0.1 | reference:scripts [2026/06/17 14:35] (current) – privacyl0st | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Core Automation Scripts ====== | ||
| + | This repository centralizes all bash scripts utilized for Day-2 background operations and Disaster Recovery orchestration. | ||
| + | |||
| + | These scripts should be saved locally on the respective Linux hosts and made executable using `chmod +x < | ||
| + | |||
| + | ===== Veeam DR Hook Scripts (VM-A) ===== | ||
| + | Executed by Veeam CE to gracefully pause databases before taking an image-level snapshot. Required by [[operations: | ||
| + | |||
| + | ==== veeam_pre_job.sh ==== | ||
| + | <file bash / | ||
| + | #!/bin/bash | ||
| + | # Pre-Freeze Application Quiescence | ||
| + | echo " | ||
| + | nordvpn set killswitch off | ||
| + | nordvpn disconnect | ||
| + | |||
| + | echo " | ||
| + | systemctl stop prowlarr radarr sonarr lidarr qbittorrent-nox cleanuparr | ||
| + | |||
| + | echo " | ||
| + | docker pause byparr | ||
| + | exit 0 | ||
| + | </ | ||
| + | |||
| + | ==== veeam_post_job.sh ==== | ||
| + | <file bash / | ||
| + | #!/bin/bash | ||
| + | # Post-Thaw Application Recovery | ||
| + | echo " | ||
| + | nordvpn connect | ||
| + | nordvpn set killswitch on | ||
| + | |||
| + | echo " | ||
| + | systemctl start prowlarr radarr sonarr lidarr qbittorrent-nox cleanuparr | ||
| + | |||
| + | echo " | ||
| + | docker unpause byparr | ||
| + | exit 0 | ||
| + | </ | ||
| + | |||
| + | ===== VPN Watchdog Engine (VM-A) ===== | ||
| + | A self-healing loop that tests the `nordlynx` interface for silent drops. Required by [[operations: | ||
| + | |||
| + | ==== vpn_watchdog.sh ==== | ||
| + | <file bash / | ||
| + | #!/bin/bash | ||
| + | # Test external routing via the VPN interface | ||
| + | if ! ping -I nordlynx -c 3 1.1.1.1 > /dev/null 2>& | ||
| + | echo " | ||
| + | systemctl stop qbittorrent-nox | ||
| + | nordvpn disconnect | ||
| + | sleep 5 | ||
| + | nordvpn connect | ||
| + | sleep 10 | ||
| + | systemctl start qbittorrent-nox | ||
| + | else | ||
| + | echo " | ||
| + | fi | ||
| + | </ | ||
| + | |||
| + | ===== Edge Proxy Backup Engine (VM-D) ===== | ||
| + | Securely packages NGINX configurations and pushes them to the NAS. Required by [[operations: | ||
| + | |||
| + | ==== edge_backup.sh ==== | ||
| + | <file bash / | ||
| + | #!/bin/bash | ||
| + | BACKUP_DATE=$(date +%F) | ||
| + | BACKUP_DIR="/ | ||
| + | TARGET_NFS="/ | ||
| + | |||
| + | mkdir -p $BACKUP_DIR | ||
| + | echo " | ||
| + | cp -R /etc/nginx $BACKUP_DIR/ | ||
| + | cp -R / | ||
| + | |||
| + | echo " | ||
| + | tar -czf $BACKUP_DIR.tar.gz -C /tmp edge_backup_$BACKUP_DATE | ||
| + | |||
| + | echo " | ||
| + | # Assumes NFS is mounted to /mnt/data on the Edge Proxy | ||
| + | mv $BACKUP_DIR.tar.gz $TARGET_NFS/ | ||
| + | |||
| + | echo " | ||
| + | rm -rf $BACKUP_DIR | ||
| + | echo " | ||
| + | </ | ||
reference/scripts.1781706861.txt.gz · Last modified: by 127.0.0.1
