Am I backing up right location?
My original backup Borg script backed up docker/immich/upload*
But now I've created a profile my assets are under: docker/immich/library/library/harry
When I point to my variables in the backup script, the Borg config.yaml file, I'm afraid I'm not backing up the right data. I'd appreciate if you could help me figure out if I'm really backing up assets and database.
Here's my Borgmatic docker mounts:
location:
#!/bin/bash
export IMMICH_DB_USERNAME="immichuser"
export IMMICH_DB_PASSWORD="immichpw"
IMMICH_POSTGRES_CONTAINER="immich-db"
BORG_CONTAINER="borgmatic"
DUMP_FILE_PATH="/volume1/docker/immich/backups/immich-database.sql"
docker start $BORG_CONTAINER
sleep 10 # 10 second delay to ensure container is running
docker exec -t -e PGPASSWORD=$IMMICH_DB_PASSWORD $IMMICH_POSTGRES_CONTAINER \
pg_dumpall --clean --if-exists --username=$IMMICH_DB_USERNAME | gzip > "${DUMP_FILE_PATH}.gz"
if [ $? -ne 0 ]; then
echo "ERROR: Database dump failed. Please check the '$IMMICH_POSTGRES_CONTAINER' container logs for details."
exit 1
fi
docker exec $BORG_CONTAINER borgmatic -v 1
But now I've created a profile my assets are under: docker/immich/library/library/harry
When I point to my variables in the backup script, the Borg config.yaml file, I'm afraid I'm not backing up the right data. I'd appreciate if you could help me figure out if I'm really backing up assets and database.
Here's my Borgmatic docker mounts:
- /volume1/docker/immich/backups:/mnt/source/immich/backups:ro
- /volume1/docker/immich/redis:/mnt/source/immich/redis:ro
- /volume1/docker/immich/cache:/mnt/source/immich/cache:ro
- /volume1/docker/immich/upload:/mnt/source/immich/upload:ro
- /volume1/docker/borgmatic/repository:/mnt/borg-repository
- /volume1/docker/borgmatic/borgmatic.d:/etc/borgmatic.d
- /volume1/docker/borgmatic/config:/root/.config/borg
- /volume1/docker/borgmatic/ssh:/root/.ssh
- /volume1/docker/borgmatic/cache:/root/.cache/borg
- /volume1/docker/borgmatic/state:/root/.local/state/borgmatic
location:
- /mnt/source/immich/upload
- /mnt/source/immich/backups/immich-database.sql.gz
- /mnt/borg-repository
#!/bin/bash
export IMMICH_DB_USERNAME="immichuser"
export IMMICH_DB_PASSWORD="immichpw"
IMMICH_POSTGRES_CONTAINER="immich-db"
BORG_CONTAINER="borgmatic"
DUMP_FILE_PATH="/volume1/docker/immich/backups/immich-database.sql"
docker start $BORG_CONTAINER
sleep 10 # 10 second delay to ensure container is running
docker exec -t -e PGPASSWORD=$IMMICH_DB_PASSWORD $IMMICH_POSTGRES_CONTAINER \
pg_dumpall --clean --if-exists --username=$IMMICH_DB_USERNAME | gzip > "${DUMP_FILE_PATH}.gz"
if [ $? -ne 0 ]; then
echo "ERROR: Database dump failed. Please check the '$IMMICH_POSTGRES_CONTAINER' container logs for details."
exit 1
fi
docker exec $BORG_CONTAINER borgmatic -v 1
config_copy.yaml1.44KB
immich_backup.sh1.24KB