spb/satelliteindex
Public
TypeScript 66.5%
Python 30.9%
JavaScript 1.4%
CSS 0.7%
1#!/bin/bash2# Copy the newest database dumps from the production node to the gateway (off-node backup). Run from the laptop or M1M32.3set -euo pipefail4NODE=${1:-M2M32b}5DEST=${2:-M1M32:~/backups/satelliteindex/}6ssh "${DEST%%:*}" "mkdir -p ${DEST#*:}"7ssh "$NODE" 'ls -1t ~/satelliteindex-data/backups/satelliteindex-*.dump 2>/dev/null | head -3' | while read -r f; do8 echo "copy $NODE:$f → $DEST"9 ssh "$NODE" "cat $f" | ssh "${DEST%%:*}" "cat > ${DEST#*:}$(basename "$f")"10done11ssh "${DEST%%:*}" "ls -la ${DEST#*:} | tail -5"12