From 33c3a5a1cd79b1f38b98cff264e8c54de13be4e8 Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 16 Dec 2024 16:14:42 +0100 Subject: [PATCH] Update btrfs-backup script --- nixos/common/software/cli/scripts/btrfs-backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/common/software/cli/scripts/btrfs-backup.sh b/nixos/common/software/cli/scripts/btrfs-backup.sh index 9f9140fe..60622087 100755 --- a/nixos/common/software/cli/scripts/btrfs-backup.sh +++ b/nixos/common/software/cli/scripts/btrfs-backup.sh @@ -29,7 +29,7 @@ fi # Get latest snapshot number from snapper LATEST_SNAPSHOT=$(sudo snapper -c "$SNAPPER_CONFIG" list | tail -n 1 | awk '{print $1}') - +HOSTNME=$(hostname) REMOTE_HOST="root@synology" BASE_DEST_PATH="/volume1/BTRFS_Receives/`hostname`/${SNAPPER_CONFIG}" DEST_PATH="/volume1/BTRFS_Receives/`hostname`/${SNAPPER_CONFIG}/${LATEST_SNAPSHOT}" @@ -73,8 +73,8 @@ verify_remote() { # Function to get remote snapshots get_remote_snapshots() { - # ssh "$REMOTE_HOST" "find '$BASE_DEST_PATH' -maxdepth 2 -type d -name 'snapshot*' | sort -n" - ssh "$REMOTE_HOST" "btrfs subvolume list /volume1/ -t | grep `hostname` | grep $SNAPPER_CONFIG" + ssh "$REMOTE_HOST" "find '$BASE_DEST_PATH' -maxdepth 2 -type d -name 'snapshot*' | sort -n" + # ssh "$REMOTE_HOST" "btrfs subvolume list /volume1/ -t | grep $HOSTNAME | grep $SNAPPER_CONFIG" } # Function to cleanup old remote snapshots