cleanup deployment

This commit is contained in:
Philipp Fruck 2025-09-17 13:33:03 +02:00
parent c1c12cfa76
commit 73383eff43
No known key found for this signature in database
GPG key ID: 9B7D2672DB7F47AD
3 changed files with 8 additions and 17 deletions

6
backup.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/sh
time=$(date +"%Y-%m-%dT%H:%M:%S%z")
dir=backup
[ -d "${dir}" ] || mkdir -p "${dir}"
docker compose run --rm -u postgres inventree-db sh -c 'PGPASSWORD=$POSTGRES_PASSWORD pg_dump -h inventree-db -p 5432 -U $POSTGRES_USER inventree' > "${dir}/${time}.sql"
# to restore: pg_restore -d newdb db.dump