explaingit

akshayskrishna/immich-backup-snapshot

Analysis updated 2026-05-18

1ShellAudience · ops devopsComplexity · 2/5Setup · easy

TLDR

A shell script that backs up an entire self-hosted Immich photo library, database and all, on a schedule you choose.

Mindmap

mindmap
  root((Immich Snapshot))
    What it does
      Full database dump
      Media file copy
      Optional cron schedule
      Safe stop and restart
    Tech stack
      Bash
      Docker
      PostgreSQL
      rsync
    Use cases
      Backup self hosted photos
      Scheduled snapshots
      Disaster recovery prep
    Audience
      Self hosters
      Home lab users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Take a full, consistent backup of a self-hosted Immich photo library and its database in one run.

USE CASE 2

Schedule automatic recurring backups of an Immich server using the script's built-in cron setup.

USE CASE 3

Back up an external media library alongside Immich's own storage before performing server maintenance.

What is it built with?

BashDockerPostgreSQLrsync

How does it compare?

akshayskrishna/immich-backup-snapshot100/dotfilesadams549659584/my-openwrt-actions
Stars111
LanguageShellShellShell
Last pushed2016-11-182020-06-06
MaintenanceDormantDormant
Setup difficultyeasyeasyhard
Complexity2/51/53/5
Audienceops devopsdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires bash, docker, rsync, and gzip already installed, the backup destination folder must exist beforehand.

In plain English

Immich Snapshot Tool is a shell script that creates a full backup of an Immich installation. Immich is a self-hosted photo and video library that people run in Docker, and this script backs up both its database and its media files in one complete snapshot rather than doing an incremental backup that only copies changes. When you run it interactively, the script asks a series of questions: whether the current folder is the Immich Docker Compose folder or where the correct one is, where the backup should be stored, and whether there is an external media library path to include as well. It also offers to set up an optional cron schedule so backups run automatically, with choices like daily, weekly, twice a month, once a month, or just once immediately, and it asks for the specific timing details that schedule needs, such as the hour of day or day of week. For the backup itself, the script creates a compressed dump of Immich's PostgreSQL database using common environment variables Immich containers already set, then briefly stops the Immich Docker stack so the file copy is not interrupted mid-write, copies the media storage and any external library using rsync, and starts Immich back up again afterward, including in cases where an earlier step failed, so a backup run never leaves the service down. The README lists some safety behavior: the backup destination folder must already exist and be writable, the script refuses to write backups inside the same folder tree it is copying from, and it recommends testing everything interactively before turning on the cron schedule. It requires bash, docker, rsync, gzip, and a handful of standard Unix command line tools to be present on the machine running it. Two companion projects are mentioned: a sibling repository offers an incremental version of this same backup for large libraries where copying everything each time is wasteful, and another sibling repository provides a restore script that reads the manifest this backup tool writes to restore a snapshot. No license is stated in the README.

Copy-paste prompts

Prompt 1
Walk me through running Immich Snapshot Tool interactively to back up my Immich Docker deployment for the first time.
Prompt 2
Help me build a non-interactive command to run Immich Snapshot Tool with a cron job using its --once and --yes flags.
Prompt 3
Explain what environment variables Immich Snapshot Tool uses to find and dump the PostgreSQL database.
Prompt 4
Show me how Immich Snapshot Tool decides where to store backups safely and what checks it does first.

Frequently asked questions

What is immich-backup-snapshot?

A shell script that backs up an entire self-hosted Immich photo library, database and all, on a schedule you choose.

What language is immich-backup-snapshot written in?

Mainly Shell. The stack also includes Bash, Docker, PostgreSQL.

How hard is immich-backup-snapshot to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is immich-backup-snapshot for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.