cb_backup.py 文件源码

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

项目:chef_community_cookbooks 作者: DennyZhang 项目源码 文件源码
def cb_backup_bucket(bucket, backup_method = ""):
    if backup_method == "":
        today = date.today()
        day = calendar.day_name[today.weekday()]
        # Run DB backup with complete/diff/accu in different days
        backup_method = weekday_method.get(day)
    backup_command = cb_backup_command(bucket, backup_method)
    log.info("Backup Couchbase bucket: %s, method: %s" % (bucket, backup_method))
    log.info("Run command: %s" % (backup_command))
    # TODO: get command output
    returncode = subprocess.call(backup_command, shell=True)
    if returncode != 0:
        log.error("Backup fails for %s" % (bucket))
        sys.exit(returncode)

################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号