moviewyrm/postgres-docker/backup.sh
Joel Bradshaw 2e9574d53c Add database to filename, don't install recommends
Cron comes with just a metric ton of recommended dependencies including
mariadb-common which is just a bunch of unneccessary weight. Just
install what's necessary for cron.
2021-12-28 14:18:57 -08:00

8 lines
227 B
Bash
Executable file

#!/bin/bash
if [ -z "$POSTGRES_DB" ]; then
echo "Database not specified, defaulting to bookwyrm"
fi
BACKUP_DB=${POSTGRES_DB:-bookwyrm}
filename=backup_${BACKUP_DB}_$(date +%F)
pg_dump -U $BACKUP_DB > /backups/$filename.sql