代码拉取完成,页面将自动刷新
#!/bin/bash
# ftpsync wrapper for tunasync
# requires: ftpsync, rsync
set -e
set -o pipefail
set -u
export LOGNAME=tunasync
FTPSYNC="${FTPSYNC:-"ftpsync"}"
FTPSYNC_LOG_DIR="${FTPSYNC_LOG_DIR:-"/var/log/ftpsync"}"
trap 'kill $(jobs -p)' EXIT
if [[ $1 == sync:archive:* ]]; then
${FTPSYNC} $1 &
PID=$!
jobname=${1##sync:archive:}
jobname=${jobname//\/}
jobname=${jobname//.}
sleep 2
if [[ ! -f ${FTPSYNC_LOG_DIR}/ftpsync-${jobname}.log ]]; then
echo "Failed to start ftpsync, please check configuration file."
exit 1
fi
tail --retry -f "${FTPSYNC_LOG_DIR}/ftpsync-${jobname}.log" &
tail --retry -f "${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.log" &
tail --retry -f "${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.error" &
wait $PID
sz=$(tail -n 15 ${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.log.0|grep -Po '(?<=Total file size: )\d+')
[[ -z "$sz" ]] || echo "Total size is" $(numfmt --to=iec $sz)
else
echo "Invalid command line"
exit 1
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。