diff --git a/src/tm_mad/nfs/tm_clone.sh b/src/tm_mad/nfs/tm_clone.sh index b54c826517..62c33fc2e8 100755 --- a/src/tm_mad/nfs/tm_clone.sh +++ b/src/tm_mad/nfs/tm_clone.sh @@ -34,8 +34,8 @@ DST_PATH=`arg_path $DST` fix_paths -log "$1 $2" -log "DST: $DST_PATH" +log_debug "$1 $2" +log_debug "DST: $DST_PATH" DST_DIR=`dirname $DST_PATH` @@ -46,12 +46,14 @@ exec_and_log "chmod a+w $DST_DIR" case $SRC in http://*) log "Downloading $SRC" - exec_and_log "$WGET -O $DST_PATH $SRC" + exec_and_log "$WGET -O $DST_PATH $SRC" \ + "Error downloading $SRC" ;; *) log "Cloning $SRC_PATH" - exec_and_log "cp -r $SRC_PATH $DST_PATH" + exec_and_log "cp -r $SRC_PATH $DST_PATH" \ + "Error copying $SRC to $DST" ;; esac diff --git a/src/tm_mad/nfs/tm_context.sh b/src/tm_mad/nfs/tm_context.sh index b079622054..f211024f3d 100755 --- a/src/tm_mad/nfs/tm_context.sh +++ b/src/tm_mad/nfs/tm_context.sh @@ -48,16 +48,19 @@ exec_and_log "mkdir -p $ISO_DIR" for f in $SRC; do case $f in http://*) - exec_and_log "$WGET -O $ISO_DIR $f" + exec_and_log "$WGET -O $ISO_DIR $f" \ + "Error downloading $f" ;; *) - exec_and_log "cp -R $f $ISO_DIR" + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" ;; esac done -exec_and_log "$MKISOFS -o $DST_PATH -J -R $ISO_DIR" +exec_and_log "$MKISOFS -o $DST_PATH -J -R $ISO_DIR" \ + "Error creating iso fs" exec_and_log "rm -rf $ISO_DIR" diff --git a/src/tm_mad/nfs/tm_delete.sh b/src/tm_mad/nfs/tm_delete.sh index cf1ff88742..942e0678cf 100755 --- a/src/tm_mad/nfs/tm_delete.sh +++ b/src/tm_mad/nfs/tm_delete.sh @@ -34,4 +34,5 @@ SRC_PATH=`arg_path $SRC` fix_src_path log "Deleting $SRC_PATH" -exec_and_log "rm -rf $SRC_PATH" +exec_and_log "rm -rf $SRC_PATH" \ + "Error deleting $SRC_PATH" diff --git a/src/tm_mad/nfs/tm_ln.sh b/src/tm_mad/nfs/tm_ln.sh index 33b4a2a21c..1a3578e7b6 100755 --- a/src/tm_mad/nfs/tm_ln.sh +++ b/src/tm_mad/nfs/tm_ln.sh @@ -37,7 +37,8 @@ fix_dst_path DST_DIR=`dirname $DST_PATH` log "Creating directory $DST_DIR" -exec_and_log "mkdir -p $DST_DIR" +exec_and_log "mkdir -p $DST_DIR" \ + "Could not create directory $DST_DIR" exec_and_log "chmod a+w $DST_DIR" log "Link $SRC_PATH" diff --git a/src/tm_mad/nfs/tm_mkimage.sh b/src/tm_mad/nfs/tm_mkimage.sh index ddafb405ec..b30c0ff327 100755 --- a/src/tm_mad/nfs/tm_mkimage.sh +++ b/src/tm_mad/nfs/tm_mkimage.sh @@ -36,8 +36,11 @@ fix_dst_path DST_DIR=`dirname $DST_PATH` -exec_and_log "mkdir -p $DST_DIR" -exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" -exec_and_log "$MKFS -t $FSTYPE -F $DST_PATH" +exec_and_log "mkdir -p $DST_DIR" \ + "Error creating directory $DST_DIR" +exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image $DST_PATH" +exec_and_log "$MKFS -t $FSTYPE -F $DST_PATH" \ + "Unable to create filesystem $FSTYPE in $DST_PATH" exec_and_log "chmod a+rw $DST_PATH" diff --git a/src/tm_mad/nfs/tm_mkswap.sh b/src/tm_mad/nfs/tm_mkswap.sh index af78a59087..58b1e286fb 100755 --- a/src/tm_mad/nfs/tm_mkswap.sh +++ b/src/tm_mad/nfs/tm_mkswap.sh @@ -35,15 +35,17 @@ fix_dst_path DST_DIR=`dirname $DST_PATH` -log "Creating directory $DST_DIR" +log_debug "Creating directory $DST_DIR" exec_and_log "mkdir -p $DST_DIR" exec_and_log "chmod a+w $DST_DIR" -log "Creating ${SIZE}Mb image in $DST_PATH" -exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" +log_debug "Creating ${SIZE}Mb image in $DST_PATH" +exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image file $DST_PATH" -log "Initializing swap space" -exec_and_log "$MKSWAP $DST_PATH" +log_debug "Initializing swap space" +exec_and_log "$MKSWAP $DST_PATH" \ + "Could not create swap on $DST_PATH" exec_and_log "chmod a+w $DST_PATH" diff --git a/src/tm_mad/nfs/tm_mv.sh b/src/tm_mad/nfs/tm_mv.sh index 68902f969b..23483b6655 100755 --- a/src/tm_mad/nfs/tm_mv.sh +++ b/src/tm_mad/nfs/tm_mv.sh @@ -43,7 +43,8 @@ else log "Will not move, is not saving image" else log "Moving $SRC_PATH" - exec_and_log "mv $SRC_PATH $DST_PATH" + exec_and_log "mv $SRC_PATH $DST_PATH" \ + "Could not move $SRC_PATH to $DST_PATH" fi fi diff --git a/src/tm_mad/ssh/tm_clone.sh b/src/tm_mad/ssh/tm_clone.sh index 8507c43e0a..71800d1874 100755 --- a/src/tm_mad/ssh/tm_clone.sh +++ b/src/tm_mad/ssh/tm_clone.sh @@ -34,23 +34,26 @@ SRC_HOST=`arg_host $SRC` DST_HOST=`arg_host $DST` -log "$1 $2" -log "DST: $DST_PATH" +log_debug "$1 $2" +log_debug "DST: $DST_PATH" DST_DIR=`dirname $DST_PATH` log "Creating directory $DST_DIR" -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" +exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Error creating directory $DST_DIR" case $SRC in http://*) log "Downloading $SRC" - exec_and_log "$SSH $DST_HOST $WGET -O $DST_PATH $SRC" + exec_and_log "$SSH $DST_HOST $WGET -O $DST_PATH $SRC" \ + "Error downloading $SRC" ;; *) log "Cloning $SRC" - exec_and_log "$SCP $SRC $DST" + exec_and_log "$SCP $SRC $DST" \ + "Error copying $SRC to $DST" ;; esac diff --git a/src/tm_mad/ssh/tm_context.sh b/src/tm_mad/ssh/tm_context.sh index ee7fd40603..322ebdaf1b 100755 --- a/src/tm_mad/ssh/tm_context.sh +++ b/src/tm_mad/ssh/tm_context.sh @@ -47,21 +47,27 @@ fi ISO_DIR="$TMP_DIR/isofiles" -exec_and_log "mkdir -p $ISO_DIR" +exec_and_log "mkdir -p $ISO_DIR" \ + "Error creating directory $ISO_DIR" for f in $SRC; do case $f in http://*) - exec_and_log "$WGET -O $ISO_DIR $f" + exec_and_log "$WGET -O $ISO_DIR $f" \ + "Error downloading $f" ;; *) - exec_and_log "cp -R $f $ISO_DIR" + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" ;; esac done -exec_and_log "$MKISOFS -o $TMP_DIR/$DST_FILE -J -R $ISO_DIR" -exec_and_log "$SCP $TMP_DIR/$DST_FILE $DST" -exec_and_log "rm -rf $TMP_DIR" +exec_and_log "$MKISOFS -o $TMP_DIR/$DST_FILE -J -R $ISO_DIR" \ + "Error creating iso fs" +exec_and_log "$SCP $TMP_DIR/$DST_FILE $DST" \ + "Error copying $TMP_DIR/$DST_FILE to $DST" +exec_and_log "rm -rf $TMP_DIR" \ + "Error deleting $TMP_DIR" diff --git a/src/tm_mad/ssh/tm_delete.sh b/src/tm_mad/ssh/tm_delete.sh index f0c7205a43..0824634ebd 100755 --- a/src/tm_mad/ssh/tm_delete.sh +++ b/src/tm_mad/ssh/tm_delete.sh @@ -31,4 +31,5 @@ SRC_PATH=`arg_path $SRC` SRC_HOST=`arg_host $SRC` log "Deleting $SRC_PATH" -exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" +exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" \ + "Error deleting $SRC_PATH" diff --git a/src/tm_mad/ssh/tm_mkimage.sh b/src/tm_mad/ssh/tm_mkimage.sh index d092a8b9b2..81ff20f32c 100755 --- a/src/tm_mad/ssh/tm_mkimage.sh +++ b/src/tm_mad/ssh/tm_mkimage.sh @@ -32,7 +32,10 @@ DST_PATH=`arg_path $DST` DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" -exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" -exec_and_log "$SSH $DST_HOST $MKFS -t $FSTYPE -F $DST_PATH" -exec_and_log "$SSH $DST_HOST chmod a+rw $DST_PATH" +exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Error creating directory $DST_DIR" +exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image $DST_PATH" +exec_and_log "$SSH $DST_HOST $MKFS -t $FSTYPE -F $DST_PATH" \ + "Unable to create filesystem $FSTYPE in $DST_PATH" +exec_and_log "$SSH $DST_HOST chmod a+rw $DST_PATH" \ No newline at end of file diff --git a/src/tm_mad/ssh/tm_mkswap.sh b/src/tm_mad/ssh/tm_mkswap.sh index 046a277bbc..60705134aa 100755 --- a/src/tm_mad/ssh/tm_mkswap.sh +++ b/src/tm_mad/ssh/tm_mkswap.sh @@ -34,10 +34,12 @@ DST_DIR=`dirname $DST_PATH` log "Creating ${SIZE}Mb image in $DST_PATH" exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" -exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" +exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image file $DST_PATH" log "Initializing swap space" -exec_and_log "$SSH $DST_HOST $MKSWAP $DST_PATH" +exec_and_log "$SSH $DST_HOST $MKSWAP $DST_PATH" \ + "Could not create swap on $DST_PATH" exec_and_log "$SSH $DST_HOST chmod a+w $DST_PATH" diff --git a/src/tm_mad/ssh/tm_mv.sh b/src/tm_mad/ssh/tm_mv.sh index 6d3ff82065..3f10354e8b 100755 --- a/src/tm_mad/ssh/tm_mv.sh +++ b/src/tm_mad/ssh/tm_mv.sh @@ -36,6 +36,8 @@ DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` log "Moving $SRC_PATH" -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" -exec_and_log "$SCP -r $SRC $DST" +exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Unable to create directory $DST_DIR" +exec_and_log "$SCP -r $SRC $DST" \ + "Could not copy $SRC to $DST" exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH"