webdav: add config

This commit is contained in:
Jef Roosens 2025-04-14 14:21:00 +02:00
parent ee7ee2b19d
commit 4b5ed5c8a5
Signed by: Jef Roosens
GPG key ID: 21FD3D77D56BAF49
13 changed files with 260 additions and 39 deletions

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
data_dir='/mnt/data1/webdav/data'
snapshot_dir="${data_dir}.snapshot"
# Read-only snapshot for atomic backup
btrfs subvolume snapshot -r "$data_dir" "$snapshot_dir" || exit $?
/usr/local/bin/restic backup "$snapshot_dir"
# Always remove snapshot subvolume, even if restic fails
btrfs subvolume delete "$snapshot_dir"