This bash script is designed to be used as part of the Duplicati event hooks. It ensures that immich_server, immich_postgres, immich_redis and immich_machine_learning are safely stopped before and restarted after backup and restore operations.
-
Add these to the Duplicati docker compose file.
environment: # Let duplicati run as root - PUID=0 - PGID=0 volumes: # Duplicati needs to be able to access docker.sock to be able to start/stop containers. - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker
- Download the shell script
wget -O immich.sh https://raw.githubusercontent.com/DLmass/immich-backup/main/immich.sh
- Make the shell script executable
sudo chmod +x immich.sh
- Move the shell script into your duplicati folder of your installation
sudo mv immich.sh /path/to/duplicati/config
Add these to your backup job configuration, can be either CLI or GUI
--run-script-before-required=/config/immich.sh
--run-script-after=/config/immich.sh