Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmirgaleev committed Feb 8, 2024
1 parent 0884965 commit 8a46c93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ case "${PG_BACKUP_ACTION:-dump}" in
fi

echo "Turning off autovacuum"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "ALTER SYSTEM SET autovacuum = off;"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "SELECT pg_reload_conf;"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "ALTER SYSTEM SET autovacuum = off;"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "SELECT pg_reload_conf;"

echo "Downloading latest snapshot from $PG_BACKUP_FILE"
curl -o dump.backup $PG_BACKUP_FILE
Expand All @@ -110,7 +110,7 @@ case "${PG_BACKUP_ACTION:-dump}" in
pg_restore -v -d $POSTGRES_DB $POSTGRES_HOST_OPTS dump.backup

echo "Re-enable autovacuum"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "ALTER SYSTEM RESET autovacuum;"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -c "SELECT pg_reload_conf;"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "ALTER SYSTEM RESET autovacuum;"
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -U $POSTGRES_USER -c "SELECT pg_reload_conf;"
;;
esac

0 comments on commit 8a46c93

Please sign in to comment.