mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-20 08:25:50 +08:00
up
This commit is contained in:
@@ -65,6 +65,13 @@ def checkArgs(data, ck=[]):
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
|
||||
def getBackupDir():
|
||||
bk_path = mw.getBackupDir() + "/database/mysql-yum"
|
||||
if not os.path.isdir(bk_path):
|
||||
mw.execShell("mkdir -p {}".format(bk_path))
|
||||
return bk_path
|
||||
|
||||
|
||||
def getConf():
|
||||
path = getServerDir() + '/etc/my.cnf'
|
||||
return path
|
||||
@@ -629,7 +636,7 @@ def __createUser(dbname, username, password, address):
|
||||
|
||||
|
||||
def getDbBackupListFunc(dbname=''):
|
||||
bkDir = mw.getBackupDir() + '/database/mysql-yum'
|
||||
bkDir = getBackupDir()
|
||||
blist = os.listdir(bkDir)
|
||||
r = []
|
||||
|
||||
@@ -729,8 +736,8 @@ def importDbBackup():
|
||||
file = args['file']
|
||||
name = args['name']
|
||||
|
||||
file_path = mw.getBackupDir() + '/database/' + file
|
||||
file_path_sql = mw.getBackupDir() + '/database/' + file.replace('.gz', '')
|
||||
file_path = getBackupDir() + '/' + file
|
||||
file_path_sql = getBackupDir() + '/' + file.replace('.gz', '')
|
||||
|
||||
if not os.path.exists(file_path_sql):
|
||||
cmd = 'cd ' + mw.getBackupDir() + '/database && gzip -d ' + file
|
||||
@@ -754,7 +761,7 @@ def deleteDbBackup():
|
||||
|
||||
path = args['path']
|
||||
full_file = ""
|
||||
bkDir = mw.getBackupDir() + '/database/mysql-yum'
|
||||
bkDir = getBackupDir()
|
||||
full_file = bkDir + '/' + args['filename']
|
||||
if path != "":
|
||||
full_file = path + "/" + args['filename']
|
||||
@@ -769,7 +776,7 @@ def getDbBackupList():
|
||||
return data[1]
|
||||
|
||||
r = getDbBackupListFunc(args['name'])
|
||||
bkDir = mw.getBackupDir() + '/database/mysql-yum'
|
||||
bkDir = getBackupDir()
|
||||
rr = []
|
||||
for x in range(0, len(r)):
|
||||
p = bkDir + '/' + r[x]
|
||||
|
||||
Reference in New Issue
Block a user