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)
################################################################################
评论列表
文章目录