WIP: kopia backup script
This commit is contained in:
17
common/global/kopia-snapshot-backup.sh
Executable file
17
common/global/kopia-snapshot-backup.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -Eeuxo pipefail
|
||||
|
||||
target_path="/persist"
|
||||
snapshot_path="$target_path/kopia-backup-snapshot"
|
||||
|
||||
if [ -e "$snapshot_path" ] && btrfs subvolume delete "$snapshot_path"; then
|
||||
echo "Deleted leftover old snapshot."
|
||||
fi
|
||||
|
||||
btrfs subvolume snapshot -r "$target_path" "$snapshot_path"
|
||||
|
||||
# --no-send-snapshot-path due to https://github.com/kopia/kopia/issues/4402
|
||||
kopia snapshot create --no-send-snapshot-report --override-source "$target_path" "$@" -- "$snapshot_path"
|
||||
|
||||
btrfs subvolume delete "$snapshot_path"
|
||||
Reference in New Issue
Block a user