diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index d0287abe2..d2db745b2 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -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'] diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 31147380b..5e8cc5ee3 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -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) diff --git a/plugins/mysql-yum/index.py b/plugins/mysql-yum/index.py index 575d5876c..7731b1a1f 100755 --- a/plugins/mysql-yum/index.py +++ b/plugins/mysql-yum/index.py @@ -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)