infrastructure/playbooks/roles/backup/files/hooks/immich_database

10 lines
228 B
Bash
Executable file

#!/usr/bin/env bash
backup_path="$1"
if [ "$2" != "before" ]; then
exit 0
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"