Initial commit (I feel unsafe)

This commit is contained in:
2026-01-16 00:11:58 -08:00
commit d69daa37bf
121 changed files with 4153 additions and 0 deletions

39
syncthing_server-backup Normal file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# shellcheck source=syncthing_server-env
. "${HOME}"/"${USER}"-env
mkdir -p "${HOME}"/backup_logs
logFile=${HOME}/backup_logs/$(date +%y_%m).log
{
echo -e "\n[+] syncthing backup\n"
mkdir -p /tmp/"${USER}"-backup
syncthing cli operations shutdown
cp -pr "${CONFIG_PATH}"/* /tmp/"${USER}"-backup
systemctl --user restart syncthing.service
if ! rclone copy /tmp/"${USER}"-backup "${BUCKET_PATH}" --exclude ./*.db/** -v; then
curl -Ss \
-H "Title: Syncthing" \
-H "Priority: 3" \
-H "Tags: warning,backup" \
-d "Backup not completed" \
"${NOTIF_URL}"
rm -r /tmp/"${USER}"-backup
exit 1
fi
curl -Ss \
-H "Title: Syncthing" \
-H "Priority: 2" \
-H "Tags: heavy_check_mark,backup" \
-d "Backup completed" \
"${NOTIF_URL}"
rm -r /tmp/"${USER}"-backup
} &>>"$logFile"