logo
tt's Note
  • 运维
    • 数据库
    • linux
    • vpn
    • 日志
    • 中间件
    • 服务
    • 监控
    • shell
    • windows
    • 语言
    • 云服务
    • 其他
  • 开发
    • 工具
  • 软件
    • 浏览器
    • 多端
    • win
    • mac
    • 网站
  • 项目
    • 效率工具
    • 兴趣
  • 脚本
    • jenkins
    shell概览
    rsync
    shell学习
    初始化相关
    快速脚本合集
    shell输出表格
    上一页shell概览下一页shell学习

    #rsync

    #rsync断点续传

    #!/bin/bash
    
    cmd_status=1
    while [ ${cmd_status} != 0 ]; do
    # rsync -rP -e "ssh -i /root/test.pem" /data/app/ 192.168.1.1:/data/app/
    # 1M/s
    # yum install nc -y
    # apt install -y netcat-openbsd
    # 老版本 nc -x
    # rsync -rP --bwlimit=1024 --rsh="ssh -o ProxyCommand='nc -x x.x.x.x:44066 %h %p'" ${des_dir}/ root@${ip}:${src_dir}/${sync_file}
    # 新版本 nc --proxy-type socks5 --proxy ${ip}:${port}
    # rsync -rP --bwlimit=1024 --rsh="ssh -o ProxyCommand='nc --proxy-type socks5 --proxy-auth username:password --proxy x.x.x.x:44066 %h %p'" ${des_dir}/ root@${ip}:${src_dir}/${sync_file}
    rsync -rP --bwlimit=1024 --rsh="ssh"  /data/baksvn/20200906 root@172.31.37.123:/data/baksvn/
    cmd_status=$?
    done

    #其他用户

    rsync -e 'ssh -l <user>'

    #其他端口

    rsync -e 'ssh -p <port>'

    #使用秘钥

    rsync -e 'ssh -i <key>'