mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
Merge branch 'v2.3.5-dev' of https://github.com/usmannasir/cyberpanel into v2.3.5-dev
This commit is contained in:
@@ -1069,6 +1069,28 @@ bind-address=%s
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[deleteDatabase]")
|
||||
return str(msg)
|
||||
|
||||
@staticmethod
|
||||
def UpgradeMariaDB(tempStatusPath):
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Creating backup of MySQL..,10')
|
||||
|
||||
MySQLBackupDir = '/var/lib/mysql-backupcp'
|
||||
from os import getuid
|
||||
if getuid() != 0:
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'This function should run as root. [404]')
|
||||
return 0, 'This function should run as root.'
|
||||
|
||||
|
||||
if not os.path.exists(MySQLBackupDir):
|
||||
command = 'rsync -av /var/lib/mysql/ /var/lib/mysql-backupcp/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'MySQL backup created..,20')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='CyberPanel')
|
||||
parser.add_argument('function', help='Specific a function to call!')
|
||||
|
||||
Reference in New Issue
Block a user