Improve usage of pg_dump in backup

This commit is contained in:
Tobias Reisinger 2026-02-01 20:33:25 +01:00
parent 731647be9d
commit f7936633e5
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
3 changed files with 13 additions and 14 deletions

View file

@ -7,4 +7,5 @@ if [ "$2" != "before" ]; then
fi
cd /opt/services/immich || exit
docker compose exec database sh -c 'pg_dump -U "$DB_USERNAME" "$DB_DATABASE"' | gzip >"$backup_path/immich.sql.gz"
docker compose exec database sh -c 'pg_dump -U "$DB_USERNAME" -Fc -C -Zzstd:5 "$DB_DATABASE"' >"$backup_path/immich.dump"