#!/bin/sh # 3GOD depot (now wardrobegod's depot/) → Google Drive. Mirrors ~/meshgod-backups/archive.sh: # ultra pulls the VPS asset dir, pushes off-site to gdrive:DB-BACKUP. # # DELIBERATE DIFFERENCE FROM THE MESHGOD FLOW: **NO PRUNING.** meshgod prunes VPS .glb older than # 180d because its gallery keeps thumb+index so old entries still list. This depot is LIVE RUNTIME # INFRASTRUCTURE — thriftgod (web/index.html:1176) and procity (loaders.js:7) fetch assets from it # by filename at runtime, so deleting an old .glb breaks a shipping game with a 404. Archive only. # # Lives outside ~/Documents on purpose (launchd + TCC), uses absolute homebrew paths. set -u LOCAL="$HOME/depot-backups"; REMOTE="gdrive"; DEST="DB-BACKUP/3god-depot" VPS="root@100.94.195.115"; SRC="/opt/3god/assets" LOG="$LOCAL/archive.log"; RCLONE=/opt/homebrew/bin/rclone STAMP=$(date "+%Y-%m-%d %H:%M"); mkdir -p "$LOCAL/assets" if rsync -a --delete-excluded -e "ssh -o ConnectTimeout=15" "$VPS:$SRC/" "$LOCAL/assets/" 2>>"$LOG"; then echo "$STAMP pulled depot from VPS ($(ls "$LOCAL/assets" | wc -l | tr -d ' ') files)" >> "$LOG" else echo "$STAMP WARN pull failed" >> "$LOG"; exit 1 fi # meta.json carries the depot's tag/note sidecar — small but the only non-reconstructable bit. if "$RCLONE" copy "$LOCAL/assets" "$REMOTE:$DEST" \ --include "*.glb" --include "*.png" --include "*.jpg" --include "*.jpeg" --include "*.webp" \ --include "meta.json" \ --transfers 3 --checkers 4 --log-file "$LOG" --log-level INFO; then N=$("$RCLONE" size "$REMOTE:$DEST" --json 2>/dev/null | /usr/bin/sed -n 's/.*"count":\([0-9]*\).*/\1/p') echo "$STAMP pushed to $REMOTE:$DEST (remote now $N objects)" >> "$LOG" else echo "$STAMP WARN rclone push failed" >> "$LOG"; exit 1 fi