Skip to content

Instantly share code, notes, and snippets.

@aviv926
aviv926 / Immich backup script for Windows
Last active October 1, 2024 12:54
Full disclosure: This script was created with an AI assistant, and it worked for me.
# Variables
$containerName = "immich_postgres"
$backupFile = "immich_dump.sql.gz"
$backupPath = "/tmp/$backupFile" # Path inside the Docker container
$backupFolder = "$Env:USERPROFILE\Desktop\Immich DB backups" # Folder on Windows desktop to store backups
# Ensure the backup folder exists; if not, create it
if (-not (Test-Path -Path $backupFolder)) {
Write-Host "Creating backup folder at $backupFolder..." -ForegroundColor Cyan
New-Item -ItemType Directory -Path $backupFolder