CI / build (push) Successful in 2m0s
Vite/React + shadcn/ui frontend with Superhuman-style keyboard nav (j/k/o/v/e/s/u, feed switching, localStorage caching for instant loads) backed by an Express API that polls the HN Firebase API into Postgres and serves cached feeds/comments. Instrumented with OpenTelemetry (traces/metrics/logs via OTLP/HTTP).
17 lines
495 B
Bash
Executable File
17 lines
495 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Nightly Postgres backup for the HN Reader app. Invoked by app-54d6877c-backup.timer.
|
|
set -euo pipefail
|
|
|
|
BACKUP_DIR="/home/exedev/backups"
|
|
RETENTION_DAYS=7
|
|
TIMESTAMP="$(date -u +%Y%m%dT%H%M%SZ)"
|
|
FILE="$BACKUP_DIR/hn-reader-$TIMESTAMP.sql.gz"
|
|
|
|
mkdir -p "$BACKUP_DIR"
|
|
|
|
docker exec hn-reader-postgres pg_dump -U hnreader -d hnreader | gzip > "$FILE"
|
|
|
|
find "$BACKUP_DIR" -name 'hn-reader-*.sql.gz' -mtime +"$RETENTION_DAYS" -delete
|
|
|
|
echo "Backed up hn-reader database to $FILE"
|