This commit is contained in:
midoks
2022-12-17 21:28:31 +08:00
parent 579a84c6f1
commit 87cf208dfc
3 changed files with 17 additions and 19 deletions
+1 -1
View File
@@ -798,7 +798,7 @@ def deleteDbBackup():
path = args['path']
full_file = ""
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getRootDir() + '/backup/database/mariadb'
full_file = bkDir + '/' + args['filename']
if path != "":
full_file = path + "/" + args['filename']
+8 -9
View File
@@ -650,7 +650,7 @@ def __createUser(dbname, username, password, address):
def getDbBackupListFunc(dbname=''):
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getBackupDir() + '/database/mysql-apt'
blist = os.listdir(bkDir)
r = []
@@ -684,7 +684,7 @@ def importDbExternal():
file = args['file']
name = args['name']
import_dir = mw.getRootDir() + '/backup/import/'
import_dir = mw.getBackupDir() + '/import/'
file_path = import_dir + file
if not os.path.exists(file_path):
@@ -750,11 +750,11 @@ def importDbBackup():
file = args['file']
name = args['name']
file_path = mw.getRootDir() + '/backup/database/' + file
file_path_sql = mw.getRootDir() + '/backup/database/' + file.replace('.gz', '')
file_path = mw.getBackupDir() + '/database/' + file
file_path_sql = mw.getBackupDir() + '/database/' + file.replace('.gz', '')
if not os.path.exists(file_path_sql):
cmd = 'cd ' + mw.getRootDir() + '/backup/database && gzip -d ' + file
cmd = 'cd ' + mw.getBackupDir() + '/database && gzip -d ' + file
mw.execShell(cmd)
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
@@ -775,7 +775,7 @@ def deleteDbBackup():
path = args['path']
full_file = ""
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getBackupDir() + '/database/mysql-apt'
full_file = bkDir + '/' + args['filename']
if path != "":
full_file = path + "/" + args['filename']
@@ -790,7 +790,7 @@ def getDbBackupList():
return data[1]
r = getDbBackupListFunc(args['name'])
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getBackupDir() + '/database/mysql-apt'
rr = []
for x in range(0, len(r)):
p = bkDir + '/' + r[x]
@@ -812,8 +812,7 @@ def getDbBackupList():
def getDbBackupImportList():
bkImportDir = mw.getRootDir() + '/backup/import'
bkImportDir = mw.getBackupDir() + '/import'
if not os.path.exists(bkImportDir):
os.mkdir(bkImportDir)
+8 -9
View File
@@ -629,7 +629,7 @@ def __createUser(dbname, username, password, address):
def getDbBackupListFunc(dbname=''):
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getBackupDir() + '/database/mysql-yum'
blist = os.listdir(bkDir)
r = []
@@ -663,7 +663,7 @@ def importDbExternal():
file = args['file']
name = args['name']
import_dir = mw.getRootDir() + '/backup/import/'
import_dir = mw.getBackupDir() + '/import/'
file_path = import_dir + file
if not os.path.exists(file_path):
@@ -729,11 +729,11 @@ def importDbBackup():
file = args['file']
name = args['name']
file_path = mw.getRootDir() + '/backup/database/' + file
file_path_sql = mw.getRootDir() + '/backup/database/' + file.replace('.gz', '')
file_path = mw.getBackupDir() + '/database/' + file
file_path_sql = mw.getBackupDir() + '/database/' + file.replace('.gz', '')
if not os.path.exists(file_path_sql):
cmd = 'cd ' + mw.getRootDir() + '/backup/database && gzip -d ' + file
cmd = 'cd ' + mw.getBackupDir() + '/database && gzip -d ' + file
mw.execShell(cmd)
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
@@ -754,7 +754,7 @@ def deleteDbBackup():
path = args['path']
full_file = ""
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getBackupDir() + '/database/mysql-yum'
full_file = bkDir + '/' + args['filename']
if path != "":
full_file = path + "/" + args['filename']
@@ -769,7 +769,7 @@ def getDbBackupList():
return data[1]
r = getDbBackupListFunc(args['name'])
bkDir = mw.getRootDir() + '/backup/database'
bkDir = mw.getBackupDir() + '/database/mysql-yum'
rr = []
for x in range(0, len(r)):
p = bkDir + '/' + r[x]
@@ -791,8 +791,7 @@ def getDbBackupList():
def getDbBackupImportList():
bkImportDir = mw.getRootDir() + '/backup/import'
bkImportDir = mw.getBackupDir() + '/import'
if not os.path.exists(bkImportDir):
os.mkdir(bkImportDir)