various helpful scripts
For alerting relies on Uptime Kuma with a Push monitor.
git clone
this repo to, say/home/youruser/.config/scripts
cd /home/youruser/.config/scripts/immich-backup
cp .env.example .env
edit .env
with your env data
cp immich-backup.service.example immich-backup.service
edit immich-backup.service
with your env datasudo ln -s /home/youruser/.config/scripts/immich-backup/immich-backup.service /etc/systemd/system/immich-backup.service
cp immich-backup.timer.example immich-backup.timer
edit immich-backup.timer
with your settingssudo ln -s /home/youruser/.config/scripts/immich-backup/immich-backup.timer /etc/systemd/system/immich-backup.timer
sudo systemctl daemon-reload
sudo systemctl enable immich-backup.timer
sudo systemctl start immich-backup.timer
- to see if the timer is active and the next run time:
systemctl list0timers
- to see logs of the service:
journalctl -u immich-backup.service
RESTIC_PASSWORD=xxx restic -r /restic/repo restore [snapshot_id] --target /restored/location/
- Make sure you have a compose and .env files (they should be in Portainer backup). Make sure your username and database name in .env match with what you use below
- Edit your compose, add a new volume
- /path/to/restored/location/database-backup/immich-database.sql:/var
. Point yourUPLOAD_LOCATION
to/restored/location/path/to/dir/immich
. - Run the stack
docker exec -t -u postgres immich_postgres bash -c 'PGPASSWORD="xxx" psql -U postgres -f /var/immich-database.sql'
- script could be more informative
- too many effort on internal alerting: remove all the alerts and make an external alerting script, run it as another service. It should send the error message as well.
- if script fails it's pretty brittle