From 0bcb45bac641d6c8d680cc50bb164a4ed0867a43 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 8 Nov 2016 15:03:56 -0600 Subject: [PATCH] nicer formatting --- bin/snap-sync | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/snap-sync b/bin/snap-sync index 5514104..115e747 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -113,7 +113,7 @@ fi selected_uuid="${UUIDS_ARRAY[$((disk))]}" selected_mnt="${TARGETS_ARRAY[$((disk))]}" -printf "You selected the disk with UUID %s.\n" "$selected_uuid" +printf "\nYou selected the disk with UUID %s.\n" "$selected_uuid" printf "The disk is mounted at %s.\n" "$selected_mnt" if [[ -f /etc/conf.d/snapper ]]; then @@ -127,6 +127,8 @@ selected_configs=${selected_configs:-$SNAPPER_CONFIGS} for x in $selected_configs; do + printf "\n" + if [[ -f "/etc/snapper/configs/$x" ]]; then source /etc/snapper/configs/$x else @@ -134,8 +136,6 @@ for x in $selected_configs; do exit 1 fi - printf "At '%s' configuration\n" "$x" - old_number=$(snapper -c "$x" list -t single | awk '/'"$selected_uuid"'/ {print $1}') old_snapshot=$SUBVOLUME/.snapshots/$old_number/snapshot @@ -159,16 +159,17 @@ for x in $selected_configs; do new_info=$SUBVOLUME/.snapshots/$new_number/info.xml sync backup_location=$BACKUPDIR/$x/$new_number/ - printf "Backup location: %s\n" "$backup_location" + printf "Will backup %s to %s\n" "$new_snapshot" "$backup_location/snapshot" if [[ $noconfirm == "yes" ]]; then cont_backup="yes" else - read -r -p "Continue [Y/n]? " cont_backup + read -r -p "Continue with backup [Y/n]? " cont_backup fi if [[ "$cont_backup" != [Yy]"es" && "$cont_backup" != [Yy] ]]; then - printf "Skipping this configuration.\n" + printf "Aborting backup for this configuration.\n" + snapper -c $x delete $new_number continue fi