招聘&找人需要bash脚本 rsync控制 300元

头像
133****0199
170阅读1评论

rsync在同步文件到远端时,偶尔会因为网络抖动因素导致速度从x Mb/s下降至 x Kb/s
此时需要kill rsync进程,重新启动rsync同步进程,才能恢复速度
我需要一个rsync同步速度的分析脚本,最好是bash脚本,python也可
脚本的功能为判断rsync实时传输速度,如果掉到某个速度区间并且持续一段时间(几十秒),则kill掉rsync父进程即可

目前我的rsync同步脚本大概为

while true; do
  ls -Sr *.mov 2>/dev/null |head -1 |while read f; do
    [ -e "$f" ] || continue
    rsync --timeout=60 --remove-source-files -avcP --stats $f root@remote_host:/backup/ && echo $f >>transfered.log
  done
  sleep 2
done

你提供的脚本比如watch_rate我可能这样使用,当然你有更好的方法也行

rsync --timeout=60 --remove-source-files -avcP --stats $f root@remote_host:/backup/ |tee /dev/tty |watch_rate && echo $f >>transfered.log

费用为300

招聘类型:
外包零活
职业:
开发
工作方式:
线上兼职
需消耗电量 5
收藏
举报
加载中…
精选评论