mirror of
https://github.com/myronblair/proxmox-config
synced 2026-06-30 15:59:57 -05:00
Add VM configs, WireGuard, and MSP360 setup
- vm-configs/fstab/: fstab snapshots for JARVIS, NPM, NovaCPX, Jellyfin, MediaStack - vm-configs/network-reference.md: full IP/service/NAS/WireGuard reference - wireguard/: MediaStack wg0/wg1 and WireGuard CT nord0/wg-clients configs - msp360/: install and setup scripts + staggered backup schedule Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X8tDRrQqgLjqXebMCBNcP3
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
# MSP360 Backup - Configure only (MSP360 already installed)
|
||||
# Usage: bash msp360-setup.sh <plan_name> <full_time> <inc_time>
|
||||
# Credentials: fetched from Gitea (/etc/msp360-gitea-token) or local msp360.conf
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
CONF="$SCRIPT_DIR/msp360.conf"
|
||||
TOKEN_FILE="/etc/msp360-gitea-token"
|
||||
GITEA_RAW="https://gitea.orbishosting.com/myron/msp360-config/raw/branch/main/msp360.conf"
|
||||
CBB="/opt/local/MSP360 Backup/bin/cbbCommandLine"
|
||||
|
||||
if [ -f "$CONF" ]; then
|
||||
source "$CONF"
|
||||
elif [ -f "$TOKEN_FILE" ]; then
|
||||
GITEA_TOKEN=$(cat "$TOKEN_FILE")
|
||||
curl -sf -H "Authorization: token $GITEA_TOKEN" "$GITEA_RAW" -o /tmp/msp360.conf
|
||||
source /tmp/msp360.conf
|
||||
rm -f /tmp/msp360.conf
|
||||
else
|
||||
echo "ERROR: No msp360.conf and no /etc/msp360-gitea-token"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PLAN_NAME="${1:-${PLAN_NAME:-MyHost-Backup}}"
|
||||
FULL_TIME="${2:-${FULL_TIME:-01:00}}"
|
||||
INC_TIME="${3:-${INC_TIME:-02:00}}"
|
||||
BACKUP_PATH="${MOUNT_POINT:-/mnt/nas-backups}/${BACKUP_SUBDIR:-MSPBackups}"
|
||||
|
||||
"$CBB" activateLicense -e "$LICENSE_EMAIL" -free
|
||||
apt-get install -y cifs-utils 2>/dev/null | tail -1
|
||||
|
||||
mkdir -p "${MOUNT_POINT}" /etc/nas-creds
|
||||
[ -f /etc/nas-creds/msp360 ] || \
|
||||
printf "username=%s\npassword=%s\n" "$NAS_USER" "$NAS_PASS" > /etc/nas-creds/msp360
|
||||
chmod 600 /etc/nas-creds/msp360
|
||||
|
||||
mountpoint -q "${MOUNT_POINT}" || \
|
||||
mount -t cifs "//${NAS_HOST}/${NAS_SHARE}" "${MOUNT_POINT}" \
|
||||
-o credentials=/etc/nas-creds/msp360,uid=0,gid=0,noperm,_netdev
|
||||
|
||||
mkdir -p "$BACKUP_PATH"
|
||||
|
||||
grep -q "${MOUNT_POINT}" /etc/fstab || \
|
||||
echo "//${NAS_HOST}/${NAS_SHARE} ${MOUNT_POINT} cifs credentials=/etc/nas-creds/msp360,uid=0,gid=0,noperm,_netdev 0 0" >> /etc/fstab
|
||||
|
||||
"$CBB" addAccount -st FileSystem -d "NAS-MSPBackups" -c "$BACKUP_PATH" 2>&1
|
||||
|
||||
"$CBB" addBackupPlan \
|
||||
-n "$PLAN_NAME" \
|
||||
-a "NAS-MSPBackups" \
|
||||
-f "/" \
|
||||
-ef "/proc" -ef "/sys" -ef "/dev" -ef "/run" -ef "/tmp" -ef "/mnt" \
|
||||
-es no \
|
||||
-purge 1m -purgeBy backupDate -keepLastVersion yes \
|
||||
-runMissed yes \
|
||||
-en yes -every day -at "$INC_TIME" \
|
||||
-enFull yes -everyFull week -atFull "$FULL_TIME" -weekdayFull "su" 2>&1
|
||||
|
||||
echo "Done. Plans:"
|
||||
"$CBB" plan -l
|
||||
Reference in New Issue
Block a user