40
40
41
41
def download_sql_backup (url , user , password , dry_run = False , overwrite_existing = False , prepend_date = True , basename = None ,
42
42
output_directory = os .getcwd (), exclude_dbs = None , compression = 'none' , prefix_format = None ,
43
- timeout = 60 , http_auth = None , ** kwargs ):
43
+ timeout = 60 , http_auth = None , server_name = None , ** kwargs ):
44
44
prefix_format = prefix_format or DEFAULT_PREFIX_FORMAT
45
45
exclude_dbs = exclude_dbs .split (',' ) or []
46
46
encoding = '' if compression == 'gzip' else 'gzip'
@@ -52,6 +52,8 @@ def download_sql_backup(url, user, password, dry_run=False, overwrite_existing=F
52
52
53
53
g .doc .set_input_by_id ('input_username' , user )
54
54
g .doc .set_input_by_id ('input_password' , password )
55
+ if server_name :
56
+ g .doc .set_input_by_id ('input_servername' , server_name )
55
57
g .submit ()
56
58
57
59
try :
@@ -113,6 +115,7 @@ def download_sql_backup(url, user, password, dry_run=False, overwrite_existing=F
113
115
help = 'prepend current UTC date & time to the filename; see the --prefix-format option for custom formatting' )
114
116
parser .add_argument ('-e' , '--exclude-dbs' , default = '' ,
115
117
help = 'comma-separated list of database names to exclude from the dump' )
118
+ parser .add_argument ('-s' , '--server-name' , default = None , help = 'mysql server hostname to supply if enabled as field on login page' )
116
119
parser .add_argument ('--compression' , default = 'none' , choices = ['none' , 'zip' , 'gzip' ],
117
120
help = 'compression method for the output file - must be supported by the server (default: %(default)s)' )
118
121
parser .add_argument ('--basename' , default = None ,
0 commit comments