mirror: Print postcmd output only when running verbose
This commit is contained in:
parent
81dd2cbc50
commit
4f98c287ab
1 changed files with 9 additions and 3 deletions
|
@ -112,9 +112,15 @@ for mirror in ${SYNC} ; do
|
||||||
logmsg "Finished ${mirror} sync with exit status ${STATUS}${NOOP} ..."
|
logmsg "Finished ${mirror} sync with exit status ${STATUS}${NOOP} ..."
|
||||||
if [ "${POSTCMD}" != "" ]; then
|
if [ "${POSTCMD}" != "" ]; then
|
||||||
logmsg "Running post for ${mirror} ..."
|
logmsg "Running post for ${mirror} ..."
|
||||||
|
if [ "${VERBOSE}" -eq 1 ]; then
|
||||||
${POSTCMD} 2>&1 | tee >( \
|
${POSTCMD} 2>&1 | tee >( \
|
||||||
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
|
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
|
||||||
>> "${LOGFILE}" )
|
>> "${LOGFILE}" )
|
||||||
|
else
|
||||||
|
${POSTCMD} 2>&1 | \
|
||||||
|
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
|
||||||
|
>> "${LOGFILE}"
|
||||||
|
fi
|
||||||
logmsg "Finished post for ${mirror} ..."
|
logmsg "Finished post for ${mirror} ..."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue