Files
mc-proxy/deploy/scripts/prune-backups.sh
Kyle Isom f1e9834bd3 Add status command, deployment infrastructure, and fix proto paths
Rename proto/gen directories from mc-proxy to mc_proxy for valid protobuf
package naming. Add CLI status subcommand for querying running instance
health via gRPC. Add systemd backup service/timer and backup pruning
script. Add buf.yaml and proto-lint Makefile target. Add shutdown_timeout
config field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:34:37 -07:00

15 lines
413 B
Bash
Executable File

#!/bin/sh
set -eu
# Prune mc-proxy database backups older than RETAIN_DAYS (default 30).
BACKUP_DIR="/srv/mc-proxy/backups"
RETAIN_DAYS="${1:-30}"
if [ ! -d "${BACKUP_DIR}" ]; then
echo "Backup directory ${BACKUP_DIR} does not exist."
exit 0
fi
find "${BACKUP_DIR}" -name "mc-proxy-*.db" -type f -mtime "+${RETAIN_DAYS}" -delete
echo "Pruned backups older than ${RETAIN_DAYS} days from ${BACKUP_DIR}."