mobile_www_release.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:astoptool 作者: zouliuyun 项目源码 文件源码
def rsync_to_backup(game, region):
    print("??????????????...")
    sys.stdout.flush()
    time.sleep(30)
    config = ConfigReader(game, region)
    rsync_module = config.get("rsync_module")
    rsync_root = config.get("rsync_root")
    rsync_backup_ip = config.get("rsync_backup_ip")

    if rsync_module == "" or rsync_root == "" or rsync_backup_ip == "" :
        raise Exception('rsync config is not proper in the game config file')

    with cd(rsync_root), settings(user='root'), hide("stdout"):
        run('''rsync -art -R --delete --out-format="%n" --password-file=/etc/rsyncd.secret ./ {}::{}'''.format(rsync_backup_ip, rsync_module))

    #for i in range(3):
    #    with cd(rsync_root), settings(user='root'), hide("stdout"):
    #        out = run('''rsync -art -R --dry-run --delete --out-format="%n" --password-file=/etc/rsyncd.secret ./ {}::{}'''.format(rsync_backup_ip, rsync_module), timeout=120)
    #        
    #    if out.strip() != "":
    #        print("??????????????, ??60s?????...")
    #        sys.stdout.flush()
    #        time.sleep(60)
    #    else:
    #        print("??????!")
    #        break
    #else:
    #    print("[WARNING]: ?????????, 30s??????version.lua, ????????!!!!!!!")
    #    sys.stdout.flush()
    #    time.sleep(30)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号