Files
n8n-self-hosted/backup.sh
2025-10-05 18:37:50 +03:00

13 lines
317 B
Bash
Executable File

#!/bin/bash
date
# Exit immediately if a command exits with a non-zero status.
set -e
BACKUP_DIR="local_files/backups"
mkdir -p "${BACKUP_DIR}"
# Dump the PostgreSQL database and compress it.
docker compose exec -T n8n-psql pg_dump -U n8n -d n8n_db | gzip > "${BACKUP_DIR}/psql_n8ndb_$(date +%F_%H-%M-%S).sql.gz"