mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 22:36:12 +01:00
remove backup dir if backup is failed
This commit is contained in:
@@ -141,6 +141,9 @@ class backupSchedule:
|
|||||||
os.remove(pathToFile)
|
os.remove(pathToFile)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
command = 'rm -rf %s' % (tempStoragePath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
return 0, tempStoragePath
|
return 0, tempStoragePath
|
||||||
|
|
||||||
elif os.path.exists(schedulerPath):
|
elif os.path.exists(schedulerPath):
|
||||||
@@ -148,6 +151,8 @@ class backupSchedule:
|
|||||||
open(schedulerPath, 'r').read()),
|
open(schedulerPath, 'r').read()),
|
||||||
backupSchedule.ERROR)
|
backupSchedule.ERROR)
|
||||||
os.remove(schedulerPath)
|
os.remove(schedulerPath)
|
||||||
|
command = 'rm -rf %s' % (tempStoragePath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
return 0, 'Backup process killed.'
|
return 0, 'Backup process killed.'
|
||||||
else:
|
else:
|
||||||
if os.path.exists(status):
|
if os.path.exists(status):
|
||||||
@@ -177,6 +182,8 @@ class backupSchedule:
|
|||||||
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (open(schedulerPath, 'r').read()),
|
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (open(schedulerPath, 'r').read()),
|
||||||
backupSchedule.ERROR)
|
backupSchedule.ERROR)
|
||||||
os.remove(schedulerPath)
|
os.remove(schedulerPath)
|
||||||
|
command = 'rm -rf %s' % (tempStoragePath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
return 0, 'Backup process killed.'
|
return 0, 'Backup process killed.'
|
||||||
else:
|
else:
|
||||||
if killCounter == 1:
|
if killCounter == 1:
|
||||||
@@ -186,6 +193,8 @@ class backupSchedule:
|
|||||||
open(schedulerPath, 'r').read()),
|
open(schedulerPath, 'r').read()),
|
||||||
backupSchedule.ERROR)
|
backupSchedule.ERROR)
|
||||||
os.remove(schedulerPath)
|
os.remove(schedulerPath)
|
||||||
|
command = 'rm -rf %s' % (tempStoragePath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
return 0, 'Backup process killed.'
|
return 0, 'Backup process killed.'
|
||||||
else:
|
else:
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|||||||
Reference in New Issue
Block a user