webdav: add config
This commit is contained in:
parent
ee7ee2b19d
commit
4b5ed5c8a5
13 changed files with 260 additions and 39 deletions
12
roles/webdav/files/webdav.data.backup.sh
Normal file
12
roles/webdav/files/webdav.data.backup.sh
Normal 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"
|
||||
15
roles/webdav/files/webdav.service
Normal file
15
roles/webdav/files/webdav.service
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=WebDAV
|
||||
After=network.target network-online.target
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=webdav
|
||||
Group=webdav
|
||||
ExecStart=/usr/local/bin/webdav --config /etc/webdav/config.toml
|
||||
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue