Skip to content

Instantly share code, notes, and snippets.

View Chuckame's full-sized avatar

Chuckame Chuckame

View GitHub Profile
@Chuckame
Chuckame / db-backup.sh
Last active October 24, 2024 10:17
Backup and restore immich database: scripts made to easily backup the immich database in a docker compose env. You need the `DB_BACKUP` and `DB_BACKUPS_FOLDER` set in your `.env`, then just execute `./db-backup.sh`
#!/usr/bin/env bash
####
# This script use .env where should be defined DB_FOLDER (the PG data folder) and DB_BACKUPS_FOLDER (the backups location).
# It stops the immich stack then make the backup by zipping the db data to a tar file.
####
set -a
source .env