From 975c573652d397ef1817c68b9804707b4bb08101 Mon Sep 17 00:00:00 2001 From: Reto Kromer Date: Tue, 7 Aug 2018 15:18:02 +0200 Subject: [PATCH] use `tee` (#187) --- writelto | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/writelto b/writelto index e5e69e6..f6fad9c 100755 --- a/writelto +++ b/writelto @@ -94,11 +94,9 @@ WRITELTODIR="${LTO_LOGS}/writelto" _mkdir2 "${WRITELTODIR}" if [ -n "$RSYNC_ERR_2" ] ; then - echo "rsync exited with ${RSYNC_ERR_1} on the first pass and ${RSYNC_ERR_2} on the second pass." - echo "rsync exited with ${RSYNC_ERR_1} on the first pass and ${RSYNC_ERR_2} on the second pass." >> "${WRITELTODIR}/${TAPE_SERIAL}_writelto.txt" + echo "rsync exited with ${RSYNC_ERR_1} on the first pass and ${RSYNC_ERR_2} on the second pass." | tee -a "${WRITELTODIR}/${TAPE_SERIAL}_writelto.txt" 2>&1 else - echo "rsync exited with ${RSYNC_ERR_1}." - echo "rsync exited with ${RSYNC_ERR_1}." >> "${WRITELTODIR}/${TAPE_SERIAL}_writelto.txt" + echo "rsync exited with ${RSYNC_ERR_1}." | tee -a "${WRITELTODIR}/${TAPE_SERIAL}_writelto.txt" 2>&1 fi if [[ "${PREMIS_DB}" = "Y" ]] ; then