mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-11 15:56:11 +01:00
bug fix: incremental backups
This commit is contained in:
@@ -137,7 +137,7 @@ class IncJobs(multi.Thread):
|
|||||||
snapShotid = result.split(' ')[-2]
|
snapShotid = result.split(' ')[-2]
|
||||||
if bType == 'database':
|
if bType == 'database':
|
||||||
newSnapshot = JobSnapshots(job=self.jobid,
|
newSnapshot = JobSnapshots(job=self.jobid,
|
||||||
type='%s:%s' % (bType, backupPath.split('/')[-1].strip('.sql')),
|
type='%s:%s' % (bType, backupPath.split('/')[-1].rstrip('.sql')),
|
||||||
snapshotid=snapShotid,
|
snapshotid=snapShotid,
|
||||||
destination=self.backupDestinations)
|
destination=self.backupDestinations)
|
||||||
else:
|
else:
|
||||||
@@ -177,7 +177,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
if type == 'database':
|
if type == 'database':
|
||||||
newSnapshot = JobSnapshots(job=self.jobid,
|
newSnapshot = JobSnapshots(job=self.jobid,
|
||||||
type='%s:%s' % (type, backupPath.split('/')[-1].strip('.sql')),
|
type='%s:%s' % (type, backupPath.split('/')[-1].rstrip('.sql')),
|
||||||
snapshotid=snapShotid,
|
snapshotid=snapShotid,
|
||||||
destination=self.backupDestinations)
|
destination=self.backupDestinations)
|
||||||
else:
|
else:
|
||||||
@@ -202,7 +202,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
if type == 'database':
|
if type == 'database':
|
||||||
newSnapshot = JobSnapshots(job=self.jobid,
|
newSnapshot = JobSnapshots(job=self.jobid,
|
||||||
type='%s:%s' % (type, backupPath.split('/')[-1].strip('.sql')),
|
type='%s:%s' % (type, backupPath.split('/')[-1].rstrip('.sql')),
|
||||||
snapshotid=snapShotid,
|
snapshotid=snapShotid,
|
||||||
destination=self.backupDestinations)
|
destination=self.backupDestinations)
|
||||||
else:
|
else:
|
||||||
@@ -267,7 +267,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
if mysqlUtilities.mysqlUtilities.restoreDatabaseBackup(self.jobid.type.split(':')[1].rstrip('.sql'),
|
if mysqlUtilities.mysqlUtilities.restoreDatabaseBackup(self.jobid.type.split(':')[1].rstrip('.sql'),
|
||||||
'/home/cyberpanel', 'dummy', 'dummy') == 0:
|
'/home/cyberpanel', 'dummy', 'dummy') == 0:
|
||||||
raise BaseException
|
raise BaseException('Can not restore database backup.')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.reconstruct == 'remote':
|
if self.reconstruct == 'remote':
|
||||||
@@ -318,7 +318,7 @@ class IncJobs(multi.Thread):
|
|||||||
self.awsFunction('restore', '', self.jobid.snapshotid)
|
self.awsFunction('restore', '', self.jobid.snapshotid)
|
||||||
|
|
||||||
metaPathNew = '/home/%s/meta.xml' % (self.website)
|
metaPathNew = '/home/%s/meta.xml' % (self.website)
|
||||||
execPath = "nice -n 10 /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/IncBackups/restoreMeta.py"
|
execPath = "nice -n 10 /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/restoreMeta.py"
|
||||||
execPath = execPath + " submitRestore --metaPath %s --statusFile %s" % (metaPathNew, self.statusPath)
|
execPath = execPath + " submitRestore --metaPath %s --statusFile %s" % (metaPathNew, self.statusPath)
|
||||||
result = ProcessUtilities.outputExecutioner(execPath)
|
result = ProcessUtilities.outputExecutioner(execPath)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
@@ -559,7 +559,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
xmlpretty = prettify(metaFileXML).encode('ascii', 'ignore')
|
xmlpretty = prettify(metaFileXML).encode('ascii', 'ignore')
|
||||||
metaFile = open(metaPath, 'w')
|
metaFile = open(metaPath, 'w')
|
||||||
metaFile.write(xmlpretty)
|
metaFile.write(xmlpretty.decode('utf-8'))
|
||||||
metaFile.close()
|
metaFile.close()
|
||||||
os.chmod(metaPath, 0o640)
|
os.chmod(metaPath, 0o640)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/local/CyberCP/bin/python2
|
#!/usr/local/CyberCP/bin/python
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('/usr/local/CyberCP')
|
sys.path.append('/usr/local/CyberCP')
|
||||||
@@ -79,7 +79,7 @@ class IncScheduler():
|
|||||||
logging.statusWriter(IncScheduler.logPath, 'Failed backup for %s, error: %s.' % (web.website, result), 1)
|
logging.statusWriter(IncScheduler.logPath, 'Failed backup for %s, error: %s.' % (web.website, result), 1)
|
||||||
break
|
break
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
#!/usr/local/CyberCP/bin/python
|
#!/usr/local/CyberCP/bin/python
|
||||||
import os
|
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('/usr/local/CyberCP')
|
sys.path.append('/usr/local/CyberCP')
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||||
|
|
||||||
import django
|
import django
|
||||||
try:
|
django.setup()
|
||||||
django.setup()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
from websiteFunctions.models import Websites
|
from websiteFunctions.models import Websites
|
||||||
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
from xml.etree import ElementTree
|
from xml.etree import ElementTree
|
||||||
@@ -758,7 +758,7 @@ class WebsiteManager:
|
|||||||
diff = finalDate - now
|
diff = finalDate - now
|
||||||
Data['viewSSL'] = 1
|
Data['viewSSL'] = 1
|
||||||
Data['days'] = str(diff.days)
|
Data['days'] = str(diff.days)
|
||||||
Data['authority'] = x509.get_issuer().get_components()[1][1]
|
Data['authority'] = x509.get_issuer().get_components()[1][1].decode('utf-8')
|
||||||
|
|
||||||
if Data['authority'] == 'Denial':
|
if Data['authority'] == 'Denial':
|
||||||
Data['authority'] = '%s has SELF-SIGNED SSL.' % (self.domain)
|
Data['authority'] = '%s has SELF-SIGNED SSL.' % (self.domain)
|
||||||
@@ -866,7 +866,7 @@ class WebsiteManager:
|
|||||||
diff = finalDate - now
|
diff = finalDate - now
|
||||||
Data['viewSSL'] = 1
|
Data['viewSSL'] = 1
|
||||||
Data['days'] = str(diff.days)
|
Data['days'] = str(diff.days)
|
||||||
Data['authority'] = x509.get_issuer().get_components()[1][1]
|
Data['authority'] = x509.get_issuer().get_components()[1][1].decode('utf-8')
|
||||||
|
|
||||||
if Data['authority'] == 'Denial':
|
if Data['authority'] == 'Denial':
|
||||||
Data['authority'] = '%s has SELF-SIGNED SSL.' % (self.childDomain)
|
Data['authority'] = '%s has SELF-SIGNED SSL.' % (self.childDomain)
|
||||||
|
|||||||
Reference in New Issue
Block a user