feat: backup+mail

This commit is contained in:
2023-01-09 21:55:03 +01:00
parent 31c56db27f
commit 00f0fb6bbf
9 changed files with 142 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -e
BACKUP_NAME=backup_$(date +%Y%m%d).zip
mkdir -p ~/ths_caldav_backups/
vdirsyncer -c vsyncdir.conf sync
zip -q -r ~/ths_caldav_backups/${BACKUP_NAME} ~/ths-caldav
~/backups/backup-tools/backup_manager.py ~/ths_caldav_backups/ --debug
# send to storrage box
rsync --delete --rsh="/usr/bin/sshpass -p HISTORY_PURGED_SECRET ssh -p23" -r ths_caldav_backups/backup_20230109.zip u244665-sub2@u244665.your-storagebox.de:./
curl -H "Content-Type: application/json" \
-X POST https://async-icinga.atlantishq.de/ \
-d '{ "service" : "ths_caldav_backup", "token" : "HISTORY_PURGED_SECRET", "status" : "OK", "info" : "" }'

View File

@@ -0,0 +1,19 @@
[general]
status_path = "~/.vdirsyncer/status/"
[pair ths_caldav]
a = "ths_remote_caldav"
b = "ths_local_caldav"
collections = ["from a"]
[storage ths_remote_caldav]
type = "caldav"
read_only = true
url = "https://ths.atlantishq.de/remote.php/dav/calendars/backup/ths_shared_by_ths/"
username = "backup"
password = "HISTORY_PURGED_SECRET"
[storage ths_local_caldav]
type = "filesystem"
path = "~/ths-caldav/"
fileext = ".ics"