2022-10-09 11:33:33 +00:00
|
|
|
#!/usr/bin/env sh
|
2022-10-06 15:07:05 +00:00
|
|
|
|
|
|
|
BACKUP_DIR="/backup/database"
|
|
|
|
|
|
|
|
echo "Starting to backup postgres database"
|
|
|
|
|
2022-10-09 12:42:33 +00:00
|
|
|
mkdir --parents $BACKUP_DIR || exit 1
|
|
|
|
PGPASSWORD=$PG_PASSWORD pg_dump --host=$PG_HOST --username=$PG_USER $PG_DATABASE > $BACKUP_DIR/$PG_DATABASE.sqldump || exit 1
|
2022-10-06 15:07:05 +00:00
|
|
|
|
|
|
|
echo "Postgres database backup finished"
|