#!/bin/sh # Restore one corpus site from its snapshot and point its URLs at the public name. set -e site=$1 [ -n "$site" ] || { echo "usage: refresh-site.sh |--all"; exit 2; } if [ "$site" = "--all" ]; then tail -n +2 sites.csv | cut -d, -f1 | while read -r s; do sh "$0" "$s"; done exit 0 fi echo "restoring $site" docker compose -p corpus stop "$site" gunzip -c "snapshots/$site.sql.gz" | docker compose -p corpus exec -T "${site}_db" sh -c 'mysql' docker compose -p corpus start "$site" echo "$site is back up"