diff --git a/src/datastore_mad/remotes/ceph/cp b/src/datastore_mad/remotes/ceph/cp index 3287a823fd..60d93f25e8 100755 --- a/src/datastore_mad/remotes/ceph/cp +++ b/src/datastore_mad/remotes/ceph/cp @@ -143,7 +143,7 @@ http://*|https://*) ;; esac -exec_and_log "eval $DUMP | $SSH $DST_HOST $DD of=$TMP_DST bs=64k" \ +multiline_exec_and_log "set -e -o pipefail; $DUMP | $SSH $DST_HOST $DD of=$TMP_DST bs=64k" \ "Error dumping $SRC to $DST_HOST:$TMP_DST" if [ "$RBD_FORMAT" = "2" ]; then diff --git a/src/datastore_mad/remotes/fs/clone b/src/datastore_mad/remotes/fs/clone index 12987e6abf..4975604dda 100755 --- a/src/datastore_mad/remotes/fs/clone +++ b/src/datastore_mad/remotes/fs/clone @@ -64,7 +64,15 @@ DST=`generate_image_path` if [ -n "$BRIDGE_LIST" ]; then log "Copying remotely local image $SRC to the image repository" DST_HOST=`get_destination_host $ID` - ssh_exec_and_log "$DST_HOST" "mkdir -p $BASE_PATH; cp -f $SRC $DST" "Error copying $SRC to $DST in $DST_HOST" + + CMD=$(cat <