fix script

This commit is contained in:
Simon Larsen 2022-12-30 14:03:59 +00:00
parent aea64825ca
commit 6c3d17632c
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ export $(grep -v '^#' config.env | xargs)
echo "Starting backup...."
sudo docker run -it --net=host --rm \
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...."
sudo docker run -it --net=host --rm \
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