various helpful scripts
For alerting relies on Uptime Kuma with a Push monitor.
git clonethis repo to, say/home/youruser/.config/scriptscd /home/youruser/.config/scripts/immich-backup
cp .env.example .envedit .envwith your env data
cp immich-backup.service.example immich-backup.serviceedit immich-backup.servicewith 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.timeredit immich-backup.timerwith your settingssudo ln -s /home/youruser/.config/scripts/immich-backup/immich-backup.timer /etc/systemd/system/immich-backup.timer
sudo systemctl daemon-reloadsudo systemctl enable immich-backup.timersudo 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_LOCATIONto/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