def backup(from_host, mysql_port, os_user, os_password ): func.remote_mysql_backup(from_host, mysql_port, os_user, os_password)
def backup(from_host, mysql_port, os_user, os_password): localfile = "/home/apps/my_prog/my_dba_release/app/scripts/new_backup_mysql.sh" remotefile = "/apps/sh/mysql/new_backup_mysql.sh" v_os_port = 22 # 把备份脚本文件推送到远程服务器 func.put_sql_to_remote(from_host, v_os_port, os_user, os_password, localfile, remotefile) # 远程调用此脚本 func.remote_mysql_backup(from_host, mysql_port, os_user, os_password)