From 1d043702ef136e8f2e516c5304a57be5718f1f6f Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Thu, 9 Jul 2026 21:49:56 -0700 Subject: Initial commit: docker compose files for all self-hosted services 12 services: adguard, ampache, azuracast, flood, glance, glances, grafana, immich, invidious, jellyfin, openwebui, watchtower Each service includes a docker-compose.yml, README.md with setup instructions, and .env.example where applicable. --- immich/backup.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 immich/backup.sh (limited to 'immich/backup.sh') diff --git a/immich/backup.sh b/immich/backup.sh new file mode 100755 index 0000000..91770a9 --- /dev/null +++ b/immich/backup.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Paths +UPLOAD_LOCATION="/srv/photos" +BACKUP_PATH="/path/to/local/immich-backup" +REMOTE_HOST="user@remote-host" +REMOTE_BACKUP_PATH="/path/to/remote/immich" + + +### Local + +# Backup Immich database +docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres > "$UPLOAD_LOCATION"/database-backup/immich-database.sql +# For deduplicating backup programs such as Borg or Restic, compressing the content can increase backup size by making it harder to deduplicate. If you are using a different program or still prefer to compress, you can use the following command instead: +# docker exec -t immich_postgres pg_dumpall --clean --if-exists --username= | /usr/bin/gzip --rsyncable > "$UPLOAD_LOCATION"/database-backup/immich-database.sql.gz + +### Append to local Borg repository +borg create "$BACKUP_PATH/immich-borg::{now}" "$UPLOAD_LOCATION" --exclude "$UPLOAD_LOCATION"/thumbs/ --exclude "$UPLOAD_LOCATION"/encoded-video/ +borg prune --keep-weekly=4 --keep-monthly=3 "$BACKUP_PATH"/immich-borg +borg compact "$BACKUP_PATH"/immich-borg + + +### Append to remote Borg repository +borg create "$REMOTE_HOST:$REMOTE_BACKUP_PATH/immich-borg::{now}" "$UPLOAD_LOCATION" --exclude "$UPLOAD_LOCATION"/thumbs/ --exclude "$UPLOAD_LOCATION"/encoded-video/ +borg prune --keep-weekly=4 --keep-monthly=3 "$REMOTE_HOST:$REMOTE_BACKUP_PATH"/immich-borg +borg compact "$REMOTE_HOST:$REMOTE_BACKUP_PATH"/immich-borg -- cgit v1.3-2-g0d8e