mirror: Print postcmd output to log and console

This commit is contained in:
Timo Makinen 2020-11-12 19:24:57 +00:00
parent e099ee58ab
commit 5f8723c9c9

View file

@ -118,9 +118,9 @@ for mirror in ${SYNC} ; do
logmsg "Finished ${mirror} sync with exit status ${STATUS}${NOOP} ..."
if [ "${POSTCMD}" != "" ]; then
logmsg "Running post for ${mirror} ..."
${POSTCMD} 2>&1 | awk \
"{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
>> "${LOGFILE}"
${POSTCMD} 2>&1 | tee >( \
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
>> "${LOGFILE}" )
logmsg "Finished post for ${mirror} ..."
fi
done