fix backup and restore./

This commit is contained in:
Simon Larsen
2022-12-30 14:04:57 +00:00
parent 6c3d17632c
commit 6277661a20
2 changed files with 2 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ export $(grep -v '^#' config.env | xargs)
echo "Starting backup...."
docker run -it --net=host --rm \
sudo docker run -it --net=host --rm \
--env-file config.env \
--volume=$(pwd)$DATABASE_BACKUP_DIRECTORY:/var/lib/postgresql/data \
postgres:latest /usr/bin/pg_dump -Fc --dbname=postgresql://$DATABASE_BACKUP_USERNAME:$DATABASE_BACKUP_PASSWORD@$DATABASE_BACKUP_HOST:$DATABASE_BACKUP_PORT/$DATABASE_BACKUP_NAME --file=/var/lib/postgresql/data/db-$(date +%d).backup

View File

@@ -6,7 +6,7 @@ export $(grep -v '^#' config.env | xargs)
echo "Starting restore...."
docker run -it --net=host --rm \
sudo docker run -it --net=host --rm \
--env-file config.env \
--volume=$(pwd)$DATABASE_RESTORE_DIRECTORY:/var/lib/postgresql/data \
postgres:latest /usr/bin/pg_restore --dbname=postgresql://$DATABASE_RESTORE_USERNAME:$DATABASE_RESTORE_PASSWORD@$DATABASE_RESTORE_HOST:$DATABASE_RESTORE_PORT/$DATABASE_RESTORE_NAME /var/lib/postgresql/data/$DATABASE_RESTORE_FILENAME