any.software.gitea: started role
This commit is contained in:
parent
1fed7d327a
commit
09e19680e6
13 changed files with 305 additions and 0 deletions
12
roles/any.software.gitea/files/gitea.data.backup.sh
Normal file
12
roles/any.software.gitea/files/gitea.data.backup.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
data_dir='/mnt/data1/gitea/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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue