2
edits
Changes
m
# Move old $VEID.tar archive to $VEID.tar.backup
e "Checking for existing file ${REMOTE_HOST}:${REMOTE_DIR}${VEID}.tar (and moving it to .backup if exists)"
ssh ${REMOTE_HOST} "[ -f ${REMOTE_DIR}${VEID}.tar ] && mv -f ${REMOTE_DIR}${VEID}.tar ${REMOTE_DIR}${VEID}.tar.backup"
# Create a remote tar archive - note you can remove the ampersand from the end if you
# don't want multiple tar processes running on the remote host simultaneously.
e "Making a tar archive on remote host (this process will run in the background on the remote host)."
ssh ${REMOTE_HOST} "tar cf ${REMOTE_DIR}${VEID}.tar -C ${REMOTE_DIR}${VEID} ./ 2>/dev/null " &
Slight modification to the ezvzdump script for when no remote host is defined.
e "Commencing remote ${RSYNC} ${LOCAL_DIR}${VEID} ${REMOTE_HOST}:${REMOTE_DIR}${VEID}"
${RSYNC} ${LOCAL_DIR}${VEID}/ ${REMOTE_HOST}:${REMOTE_DIR}${VEID}/
# Move old $VEID.tar archive to $VEID.tar.backup
e "Checking for existing file ${REMOTE_HOST}:${REMOTE_DIR}${VEID}.tar (and moving it to .backup if exists)"
ssh ${REMOTE_HOST} "[ -f ${REMOTE_DIR}${VEID}.tar ] && mv -f ${REMOTE_DIR}${VEID}.tar ${REMOTE_DIR}${VEID}.tar.backup"
# Create a remote tar archive - note you can remove the ampersand from the end if you
# don't want multiple tar processes running on the remote host simultaneously.
e "Making a tar archive on remote host (this process will run in the background on the remote host)."
ssh ${REMOTE_HOST} "tar cf ${REMOTE_DIR}${VEID}.tar -C ${REMOTE_DIR}${VEID} ./ 2>/dev/null " &
fi
e "Done."