mirror of
https://gitlab.com/futile/thingy.git
synced 2026-07-21 08:10:07 +00:00
27 lines
566 B
Bash
27 lines
566 B
Bash
#!/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
|