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} ..."
|
||||
if [ "${POSTCMD}" != "" ]; then
|
||||
logmsg "Running post for ${mirror} ..."
|
||||
${POSTCMD} 2>&1 | tee >( \
|
||||
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
|
||||
>> "${LOGFILE}" )
|
||||
if [ "${VERBOSE}" -eq 1 ]; then
|
||||
${POSTCMD} 2>&1 | tee >( \
|
||||
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
|
||||
>> "${LOGFILE}" )
|
||||
else
|
||||
${POSTCMD} 2>&1 | \
|
||||
awk "{ print strftime(\"%Y/%m/%d %H:%M:%S\") \" [$$] \" \$0 }" \
|
||||
>> "${LOGFILE}"
|
||||
fi
|
||||
logmsg "Finished post for ${mirror} ..."
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue