dsnap-sync: code identation update

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2018-07-22 13:54:05 +02:00
parent d3b6c972c5
commit 9c2c9c6194

View File

@@ -180,7 +180,7 @@ create_snapshot () {
printf "${MAGENTA}Snapper source snapshot ${GREEN}'%s'${MAGENTA} created${NO_COLOR}\n" "$snapper_source_id" printf "${MAGENTA}Snapper source snapshot ${GREEN}'%s'${MAGENTA} created${NO_COLOR}\n" "$snapper_source_id"
fi fi
else else
printf "dryrun: Creating source snapshot with snapper config '%s' ...\n" "$selected_config" printf "dryrun: Would create source snapshot with snapper config '%s' ...\n" "$selected_config"
snapper_source_sync_id="<snapper_source_id>" snapper_source_sync_id="<snapper_source_id>"
fi fi
} }
@@ -976,9 +976,15 @@ run_config_preparation () {
"snapper_uuid=" "snapper_subvolid=" "remote=${remote}" "snapper_uuid=" "snapper_subvolid=" "remote=${remote}"
snapper_target_sync_id=$snapper_sync_id snapper_target_sync_id=$snapper_sync_id
if [ $snapper_target_sync_id -eq 0 ]; then if [ $snapper_target_sync_id -eq 0 ]; then
if [ $verbose -eq 1 ]; then if [ $verbose -ge 1 ]; then
if [ $remote ]; then
printf "${MAGENTA}No target shapshot available for snapper config ${GREEN}'%s'${MAGENTA} on '%s'...${NO_COLOR}\n" \ printf "${MAGENTA}No target shapshot available for snapper config ${GREEN}'%s'${MAGENTA} on '%s'...${NO_COLOR}\n" \
"$selected_config" "$remote" "$selected_config" "$remote"
else
printf "${MAGENTA}No target shapshot available for snapper config ${GREEN}'%s'${MAGENTA}...${NO_COLOR}\n" \
"$selected_config"
fi
fi fi
else else
# get backupdir from snapper target # get backupdir from snapper target
@@ -1078,7 +1084,7 @@ run_backup () {
create_snapshot create_snapshot
;; ;;
*) *)
if [ $verbose -gt 2 ]; then if [ $verbose -ge 2 ]; then
printf "{RED}TODO:{NO_COLOR} what is needed for config_type '%s'?\n" "$snapper_config_type" printf "{RED}TODO:{NO_COLOR} what is needed for config_type '%s'?\n" "$snapper_config_type"
fi fi
;; ;;
@@ -1857,16 +1863,16 @@ verify_snapper_structure () {
# verify that we have a snapper compatible structure for target config (a btrfs subvolume) # verify that we have a snapper compatible structure for target config (a btrfs subvolume)
cmd="$ssh stat --format %i $backup_root 2>/dev/null" cmd="$ssh stat --format %i $backup_root 2>/dev/null"
if [ -z $(eval $cmd) ]; then if [ -z $(eval $cmd) ]; then
if [ ! "$dryrun" ]; then
if [ $verbose -ge 1 ]; then if [ $verbose -ge 1 ]; then
if [ -z "$remote" ]; then if [ -z "$remote" ]; then
printf "${MAGENTA}Create${NO_COLOR} new snapper capable BTRFS ${MAGENTA}subvolume ${GREEN}'%s'${NO_COLOR} ...\n" \ printf "${MAGENTA}Create${NO_COLOR} new snapper capable BTRFS ${MAGENTA}subvolume ${GREEN}'%s'${NO_COLOR} ...\n" \
"$backup_root/$snapper_config" "$backup_root"
else else
printf "${MAGENTA}Create${NO_COLOR} new snapper capable BTRFS ${MAGENTA}subvolume ${GREEN}'%s'${NO_COLOR} on ${MAGENTA}remote host ${GREEN}'%s'${NO_COLOR} ...\n" \ printf "${MAGENTA}Create${NO_COLOR} new snapper capable BTRFS ${MAGENTA}subvolume ${GREEN}'%s'${NO_COLOR} on ${MAGENTA}remote host ${GREEN}'%s'${NO_COLOR} ...\n" \
"$backup_root" "$remote_host" "$backup_root" "$remote_host"
fi fi
fi fi
if [ ! "$dryrun" ]; then
# verify that we can use the correct snapper template # verify that we can use the correct snapper template
cmd="$ssh stat --format %i $SNAPPER_TEMPLATE_DIR/$snapper_subvolume_template 2>/dev/null" cmd="$ssh stat --format %i $SNAPPER_TEMPLATE_DIR/$snapper_subvolume_template 2>/dev/null"
if [ -z $(eval $cmd) ]; then if [ -z $(eval $cmd) ]; then