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