mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
bug fix: remove leftover if backup failed
This commit is contained in:
@@ -249,7 +249,7 @@ class IncScheduler():
|
|||||||
## Create CyberPanel Folder
|
## Create CyberPanel Folder
|
||||||
|
|
||||||
file_metadata = {
|
file_metadata = {
|
||||||
'name': 'CyberPanel-%s' % (ipAddress),
|
'name': '%s-%s' % (items.name, ipAddress),
|
||||||
'mimeType': 'application/vnd.google-apps.folder'
|
'mimeType': 'application/vnd.google-apps.folder'
|
||||||
}
|
}
|
||||||
file = drive.files().create(body=file_metadata,
|
file = drive.files().create(body=file_metadata,
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ class backupSchedule:
|
|||||||
command = 'sudo rm -f ' + pid
|
command = 'sudo rm -f ' + pid
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = 'rm -rf %s' % (tempStoragePath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
backupObs = Backups.objects.filter(fileName=fileName)
|
backupObs = Backups.objects.filter(fileName=fileName)
|
||||||
for items in backupObs:
|
for items in backupObs:
|
||||||
items.delete()
|
items.delete()
|
||||||
@@ -187,6 +190,10 @@ class backupSchedule:
|
|||||||
return 0, 'Backup process killed.'
|
return 0, 'Backup process killed.'
|
||||||
else:
|
else:
|
||||||
if killCounter == 1:
|
if killCounter == 1:
|
||||||
|
|
||||||
|
command = 'rm -rf %s' % (tempStoragePath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return 0, 'Backup process killed without reporting any error. [184]'
|
return 0, 'Backup process killed without reporting any error. [184]'
|
||||||
elif os.path.exists(schedulerPath):
|
elif os.path.exists(schedulerPath):
|
||||||
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (
|
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (
|
||||||
|
|||||||
Reference in New Issue
Block a user