1
0

Backups: rewrite backup script

This commit is contained in:
2025-05-05 11:48:49 +03:00
parent ddae18f8b3
commit daeef1bc4b
3 changed files with 16 additions and 61 deletions

View File

@ -5,21 +5,22 @@ set -o pipefail
echo "Backup: perform gitea backup"
su --login gitea -c '/home/gitea/gitea-dump.sh'
mkdir -p {{ backup_directory }}/gitea
mv /home/gitea/backups/* {{ backup_directory }}/gitea
su --login gitea --command '/home/gitea/backup.sh'
echo "Backup: perform backup with gobackup"
gobackup perform --config={{ backup_gobackup_config }}
echo "Backup: perform gramps backup"
su --login {{ primary_user }} --command '/home/{{ primary_user }}/applications/gramps/backup.sh'
echo "Backup: send backups to remote storage with retic"
restic-shell.sh backup --verbose {{ backup_directory }} \
restic-shell.sh backup --verbose /home/gitea/backups /home/major/applications/gramps/backups \
&& restic-shell.sh check \
&& restic-shell.sh forget --compact --prune --keep-daily 90 --keep-monthly 36 \
&& restic-shell.sh check
echo "Backup: send notification"
curl -s -X POST 'https://api.telegram.org/bot{{ notifications_tg_bot_token }}/sendMessage' \
@ -27,8 +28,4 @@ curl -s -X POST 'https://api.telegram.org/bot{{ notifications_tg_bot_token }}/se
-d 'parse_mode=HTML' \
-d 'text=<b>{{ notifications_name }}</b>: бекап успешно завершен!'
echo -e "\nRemove old files"
keep-files.py {{ backup_directory }}/gitea --keep 2
echo -e "\nBackup: done"

View File

@ -1,32 +0,0 @@
# https://gobackup.github.io/configuration
models:
gramps:
compress_with:
type: 'tgz'
storages:
local:
type: 'local'
path: '{{ (backup_directory, "gramps") | path_join }}'
keep: 2
databases:
users:
type: sqlite
path: /home/major/applications/gramps/data/gramps_users/users.sqlite
search_index:
type: sqlite
path: /home/major/applications/gramps/data/gramps_index/search_index.db
sqlite:
type: sqlite
path: /home/major/applications/gramps/data/gramps_db/59a0f3d6-1c3d-4410-8c1d-1c9c6689659f/sqlite.db
undo:
type: sqlite
path: /home/major/applications/gramps/data/gramps_db/59a0f3d6-1c3d-4410-8c1d-1c9c6689659f/undo.db
archive:
includes:
- /home/major/applications/gramps
excludes:
- /home/major/applications/gramps/data/gramps_cache
- /home/major/applications/gramps/data/gramps_thumb_cache
- /home/major/applications/gramps/data/gramps_tmp