Add services backup scripts
This commit is contained in:
21
services/backup-docspell.sh
Executable file
21
services/backup-docspell.sh
Executable 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
|
||||
Reference in New Issue
Block a user