mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-10-31 22:19:00 +00:00
13 lines
400 B
Bash
Executable file
13 lines
400 B
Bash
Executable file
#!/bin/bash
|
|
source /backups/.env
|
|
|
|
if [ -z "$POSTGRES_DB" ]; then
|
|
echo "Database not specified, defaulting to bookwyrm"
|
|
fi
|
|
if [ -z "$POSTGRES_USER" ]; then
|
|
echo "Database user not specified, defaulting to bookwyrm"
|
|
fi
|
|
BACKUP_DB=${POSTGRES_DB:-bookwyrm}
|
|
BACKUP_USER=${POSTGRES_USER:-bookwyrm}
|
|
filename=backup_${BACKUP_DB}_$(date +%F)
|
|
pg_dump -U $BACKUP_USER $BACKUP_DB > /backups/$filename.sql
|