Minor fix.
authorFrancois Fleuret <francois@fleuret.org>
Thu, 13 Jul 2017 19:02:24 +0000 (21:02 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Thu, 13 Jul 2017 19:02:24 +0000 (21:02 +0200)
xremote.sh

index da23287..83f984e 100755 (executable)
@@ -107,7 +107,7 @@ do
 
             SEND)
                 check_remote_is_defined
-                tar c "${value}" | ssh "${REMOTE_HOST}" "cd \"${REMOTE_DIR}\" && tar mx"
+                tar c ${value} | ssh "${REMOTE_HOST}" "cd \"${REMOTE_DIR}\" && tar mx"
                 ;;
 
             HOST)
@@ -115,7 +115,7 @@ do
                 REMOTE_HOST="${value}"
                 [[ "${REMOTE_HOST}" ]] || REMOTE_HOST="${XREMOTE_HOST}"
                 [[ "${REMOTE_HOST}" ]] || (echo "No remote host specified." >&2 && exit 1)
-                REMOTE_DIR="$(ssh </dev/null "${REMOTE_HOST}" mktemp -d /tmp/xremote.from_"$(hostname)_$(date +%Y%m%d)".XXXXXX)"
+                REMOTE_DIR="$(ssh </dev/null "${REMOTE_HOST}" mktemp -d /tmp/xremote.from_"$(hostname)_$(date +%Y%m%d-%H%M%S)".XXXXXX)"
                 ;;
         esac
     fi
@@ -137,6 +137,7 @@ else
     REMOTE_COMMAND="./${main}"
 fi
 
+echo "----------------------------------------------------------------------"
 ssh </dev/null "${REMOTE_HOST}" "cd \"${REMOTE_DIR}\" && ${REMOTE_COMMAND}"
 echo "----------------------------------------------------------------------"
 
@@ -155,7 +156,7 @@ do
         case "${label}" in
             GET)
                 check_remote_is_defined
-                ssh </dev/null "${REMOTE_HOST}" "cd \"${REMOTE_DIR}\" && tar c ${value}" | tar mxv
+                ssh </dev/null "${REMOTE_HOST}" "cd \"${REMOTE_DIR}\" && tar 2>/dev/null c ${value}" | tar mxv
                 ;;
         esac
     fi