TypeScript 97.6%
SQL 1.4%
JavaScript 0.5%
1#!/bin/bash2# Run ON the node: installs the daily backup launchd agent.3set -euo pipefail4APP_DIR="${1:-$HOME/apps/spinza}"5PLIST="$HOME/Library/LaunchAgents/dev.spinza.backup.plist"6mkdir -p "$HOME/Library/LaunchAgents" "$HOME/backups/spinza"7chmod +x "$APP_DIR/deploy/backup.sh"8cat >"$PLIST" <<EOF9<?xml version="1.0" encoding="UTF-8"?>10<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">11<plist version="1.0"><dict>12 <key>Label</key><string>dev.spinza.backup</string>13 <key>ProgramArguments</key><array><string>/bin/bash</string><string>$APP_DIR/deploy/backup.sh</string></array>14 <key>StartCalendarInterval</key><dict><key>Hour</key><integer>3</integer><key>Minute</key><integer>40</integer></dict>15 <key>StandardOutPath</key><string>$HOME/backups/spinza/launchd.log</string>16 <key>StandardErrorPath</key><string>$HOME/backups/spinza/launchd.err</string>17 <key>EnvironmentVariables</key><dict><key>PATH</key><string>/opt/homebrew/bin:/usr/bin:/bin</string></dict>18</dict></plist>19EOF20launchctl bootout "gui/$(id -u)/dev.spinza.backup" 2>/dev/null || true21launchctl bootstrap "gui/$(id -u)" "$PLIST"22echo "installed dev.spinza.backup (daily 03:40) → $HOME/backups/spinza"23