zoukankan      html  css  js  c++  java
  • rsync实现断点续传

    当要传送文件较大,过程中如果网络中断了,就比较悲剧了。这时候可以考虑使用rsync命令替代scp,P实现断点续传文件。
    rsync -rP --rsh=ssh /home/oracle/TestDB/ oracle@192.168.1.173:/home/oracle/TestDB
    --/bin/rsync -avz --password-file=/etc/rsyncd.pas rsyncuser@192.168.10.20::backup /home/nas/

    推送本地文件到远程
    rsync -avz /cygdrive/e/sinafund_loadoffpay.txt 10.0.225.246::di/data
    rsync -avz /Users/zhaoyang10/Documents/mis_file/wbad_client_adplanlog_day.txt 10.0.0.246::di/data
    rsync -avz /Users/zhaoyang10/Documents/mis_file/wbad_client_adplanlog_day.txt 10.0.20.11::di/data

    拉取远程文件到本地
    rsync -avz 10.0.0.246::di/data/wbad_client_adplanlog_day.txt /Users/zhaoyang10/Documents
    rsync -avz 10.0.225.11::di/dailycheck/iad/wbad_client_adplanlog_day_20190326.txt /Users/zhaoyang10/Documents
    rsync -avz 10.0.225.11::di/data/wbad_client_adplanlog_day.txt /Users/zhaoyang10/Documents

    查看远程服务器目录下所有文件
    rsync -v rsync://10.0.225.246:/di/data/
    rsync -v rsync://10.0.225.11:/di/data/
    rsync -v rsync://10.0.225.246:/di/dailycheck/iad/
    rsync -v rsync://10.0.225.11:/di/dailycheck/iad/

    RSYNC_PASSWORD=dbzeaRJ1Ob2OzxxxxaGy1VDJdPkUpsP8S2oeoF3XiPuf5fY= rsync --list-only xx@r2.xxx.com.cn::wb_ad_cust_deliver_consume/201905/06/

    有密码推送:
    密码文件:pwd.cfg文件权限必须为600,内容: dbzeaRJ1Ob2xxxxOzaGy1VDJdPkUpsP8S2oeoF3XiPuf5fY=

    生产环境脚本:
    rsync -avP --timeout=180 --password-file=/data/logs/file/mis_file/pwd.cfg /data/logs/file/mis_file/201904/16 xxx@r2.xxx.com.cn::wb_ad_cust_deliver_consume/201904

  • 相关阅读:
    bzoj1042 [ HAOI2008 ] --容斥原理+完全背包
    bzoj1079 [ SCOI2008 ] --记忆化搜索
    bzoj1584 [ Usaco2009 Mar ] --DP
    bzoj4724 [ POI2017 ] --数论
    bzoj3208--记忆化搜索
    bzoj3095--数学题
    resque 遍历加载job目录下的类
    php,js清除cookie
    nginx 设置 fastcgi缓存
    php缓冲区 sapi缓冲区
  • 原文地址:https://www.cnblogs.com/ritchy/p/13755693.html
Copyright © 2011-2022 走看看