remove empty error log...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-03-04 04:39:45 +03:00
parent 9264d26598
commit 12a024dac2

View File

@ -239,6 +239,10 @@ while true ; do
echo "Copying files from ${BASE}/${DRIVE} (~`du -hs "${BASE}/${DRIVE}" | cut -f 1`)..."
$COPY $COPYFLAGS ${BASE}/${DRIVE}/* "$DIR" \
2> >(tee "${DIR}"/copy-err.log)
# no errors -> remove log...
if ! [ -s "${DIR}/copy-err.log"] ; then
rm -f "${DIR}"/copy-err.log
fi
echo "Copying files: done."