implement basic automatic backup

This commit is contained in:
2026-07-18 20:54:30 +01:00
parent 46ab940295
commit 68a7778a7a
4 changed files with 70 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
THINGY_DIR="/home/fedora/thingy" # todo: better
LOG_FILE="/var/log/volume-backup.log"
function log() {
echo "[$(date -Iseconds)] $*" | tee -a "$LOG_FILE"
}
function cleanup() {
log "cleanup: starting docker services"
docker compose start || true
log "└───── backup finished ─────┘"
}
trap cleanup EXIT
log "┌────── backup started ─────┐"
cd "$THINGY_DIR"
log "stopping docker services"
docker compose stop
log "running backup"
/usr/local/bin/vykar backup