def backup_task(do_backups=False): """ Run backup once a day""" # Invoke backup from the staging node if do_backups: shell, node = create_ssh_conn(server_ip = cfg.BACKUP_NODE_IP, username=cfg.BACKUP_NODE_SSH_USER, password=cfg.BACKUP_NODE_SSH_PWD) logger.error("Running backup") #TODO: Support per bucket backup, by default does all #TODO: Play with num threads command_options = ['-t %s' % 4] shell.execute_cluster_backup(backup_location=cfg.BACKUP_DIR, command_options=command_options, cluster_ip=cfg.COUCHBASE_IP, cluster_port=cfg.COUCHBASE_PORT)
def exec_cmd(ip, cmd, os = "linux"): shell, node = create_ssh_conn(server_ip=ip, os=os) shell.use_sudo = False return shell.execute_command(cmd, node)
def exec_cmd(ip, cmd, os="linux"): shell, node = create_ssh_conn(server_ip=ip, os=os) shell.use_sudo = False return shell.execute_command(cmd, node)