From 0843563f8438168e08d47ec21eea112f9b92b69c Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 16 Dec 2024 15:47:58 +0100 Subject: [PATCH] Update btrfs backup script --- nixos/common/software/cli/scripts/btrfs-backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/common/software/cli/scripts/btrfs-backup.sh b/nixos/common/software/cli/scripts/btrfs-backup.sh index 7357afb8..de5a6432 100755 --- a/nixos/common/software/cli/scripts/btrfs-backup.sh +++ b/nixos/common/software/cli/scripts/btrfs-backup.sh @@ -31,6 +31,7 @@ fi LATEST_SNAPSHOT=$(sudo snapper -c "$SNAPPER_CONFIG" list | tail -n 1 | awk '{print $1}') REMOTE_HOST="root@synology" +BASE_DEST_PATH="/volume1/BTRFS_Receives/`hostname`/${SNAPPER_CONFIG}" DEST_PATH="/volume1/BTRFS_Receives/`hostname`/${SNAPPER_CONFIG}/${LATEST_SNAPSHOT}" STATE_FILE="/var/lib/snapper-backup-${SNAPPER_CONFIG}.state" LOG_FILE="/var/log/snapper-backup-${SNAPPER_CONFIG}.log" @@ -72,7 +73,7 @@ verify_remote() { # Function to get remote snapshots get_remote_snapshots() { - ssh "$REMOTE_HOST" "find '$DEST_PATH' -maxdepth 1 -type d -name 'snapshot*' | sort -n" + ssh "$REMOTE_HOST" "find '$BASE_DEST_PATH' -maxdepth 1 -type d -name 'snapshot*' | sort -n" } # Function to cleanup old remote snapshots