Add services backup scripts

This commit is contained in:
2026-08-09 14:47:19 +00:00
parent f7cc6ba83b
commit 23bd1e4c20
5 changed files with 99 additions and 0 deletions

21
services/backup-docspell.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
echo "running backup docspell script at $(date)"
backup-scripts/start-backup.sh
echo "backing up docspell!"
echo "------------------"
cd /srv/docspell/docker/docker-compose/
echo "cd to $(pwd)"
echo "executing postgres pg_dump command"
docker exec -it postgres_db pg_dump -d dbname -U dbuser -Fc -f /opt/backup/docspell.sqlc
# then backup to backups vm
echo "sending sql backup to VM"
rsync --stats --progress -arv --ignore-times /backups/docspell-backup/* sem@10.10.100.52:/home/sem/docspell-backup/
echo "sending docspell dir to VM"
rsync --stats --progress -arv --ignore-times /srv/docspell/* sem@10.10.100.52:/home/sem/docspell-backup/
# run script using absolute path because docker backup command cd's to /srv/docspell
/backups/backup-scripts/stop-backup.sh