mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
some bug fixes in wp remote backups;
;
This commit is contained in:
@@ -989,217 +989,232 @@ Automatic backup failed for %s on %s.
|
|||||||
|
|
||||||
Lastrun = config.lastrun
|
Lastrun = config.lastrun
|
||||||
Currenttime = float(time.time())
|
Currenttime = float(time.time())
|
||||||
if config.timeintervel == "30 Minutes":
|
|
||||||
al = float(Currenttime) - float(1800)
|
if config.timeintervel == function:
|
||||||
if float(al) >= float(Lastrun):
|
#al = float(Currenttime) - float(1800)
|
||||||
|
#if float(al) >= float(Lastrun):
|
||||||
#if 1 == 1:
|
#if 1 == 1:
|
||||||
extraArgs = {}
|
|
||||||
extraArgs['adminID'] = Admin.pk
|
|
||||||
extraArgs['WPid'] = wpsite.pk
|
|
||||||
extraArgs['Backuptype'] = Backuptype
|
|
||||||
extraArgs['BackupDestination'] = config.RemoteBackupConfig.configtype
|
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
extraArgs = {}
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
extraArgs['adminID'] = Admin.pk
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
extraArgs['WPid'] = wpsite.pk
|
||||||
if status == 1:
|
extraArgs['Backuptype'] = Backuptype
|
||||||
filename = msg
|
extraArgs['BackupDestination'] = config.RemoteBackupConfig.configtype
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID, config.id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.timeintervel == "1 Hour":
|
|
||||||
al = float(Currenttime) - float(3600)
|
|
||||||
if float(al) >= float(Lastrun):
|
|
||||||
# if 1 == 1:
|
|
||||||
extraArgs = {}
|
|
||||||
extraArgs['adminID'] = Admin.pk
|
|
||||||
extraArgs['WPid'] = wpsite.pk
|
|
||||||
extraArgs['Backuptype'] = Backuptype
|
|
||||||
extraArgs['BackupDestination'] = config.RemoteBackupConfig.configtype
|
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
if status == 1:
|
if status == 1:
|
||||||
filename = msg
|
filename = msg
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
command = f"rm -r {filename}"
|
command = f"rm -r {filename}"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
obj.lastrun = time.time()
|
obj.lastrun = time.time()
|
||||||
obj.save()
|
obj.save()
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
config.id)
|
config.id)
|
||||||
command = f"rm -r {filename}"
|
command = f"rm -r {filename}"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
obj.lastrun = time.time()
|
obj.lastrun = time.time()
|
||||||
obj.save()
|
obj.save()
|
||||||
elif config.timeintervel == "6 Hours":
|
|
||||||
al = float(Currenttime) - float(21600)
|
|
||||||
if float(al) >= float(Lastrun):
|
|
||||||
extraArgs = {}
|
|
||||||
extraArgs['adminID'] = Admin.pk
|
|
||||||
extraArgs['WPid'] = wpsite.pk
|
|
||||||
extraArgs['Backuptype'] = Backuptype
|
|
||||||
extraArgs['BackupDestination'] = "SFTP"
|
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
elif config.timeintervel == function:
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
#al = float(Currenttime) - float(3600)
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
#if float(al) >= float(Lastrun):
|
||||||
if status == 1:
|
# if 1 == 1:
|
||||||
filename = msg
|
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
|
||||||
config.id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.timeintervel == "12 Hours":
|
|
||||||
al = float(Currenttime) - float(43200)
|
|
||||||
if float(al) >= float(Lastrun):
|
|
||||||
extraArgs = {}
|
|
||||||
extraArgs['adminID'] = Admin.pk
|
|
||||||
extraArgs['WPid'] = wpsite.pk
|
|
||||||
extraArgs['Backuptype'] = Backuptype
|
|
||||||
extraArgs['BackupDestination'] = "SFTP"
|
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
extraArgs = {}
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
extraArgs['adminID'] = Admin.pk
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
extraArgs['WPid'] = wpsite.pk
|
||||||
if status == 1:
|
extraArgs['Backuptype'] = Backuptype
|
||||||
filename = msg
|
extraArgs['BackupDestination'] = config.RemoteBackupConfig.configtype
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
|
||||||
config.id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.timeintervel == "1 Day":
|
|
||||||
al = float(Currenttime) - float(86400)
|
|
||||||
if float(al) >= float(Lastrun):
|
|
||||||
extraArgs = {}
|
|
||||||
extraArgs['adminID'] = Admin.pk
|
|
||||||
extraArgs['WPid'] = wpsite.pk
|
|
||||||
extraArgs['Backuptype'] = Backuptype
|
|
||||||
extraArgs['BackupDestination'] = "SFTP"
|
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
if status == 1:
|
if status == 1:
|
||||||
filename = msg
|
filename = msg
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
command = f"rm -r {filename}"
|
command = f"rm -r {filename}"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
obj.lastrun = time.time()
|
obj.lastrun = time.time()
|
||||||
obj.save()
|
obj.save()
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
config.id)
|
config.id)
|
||||||
command = f"rm -r {filename}"
|
command = f"rm -r {filename}"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
obj.lastrun = time.time()
|
obj.lastrun = time.time()
|
||||||
obj.save()
|
obj.save()
|
||||||
elif config.timeintervel == "3 Days":
|
|
||||||
al = float(Currenttime) - float(259200)
|
|
||||||
if float(al) >= float(Lastrun):
|
|
||||||
extraArgs = {}
|
|
||||||
extraArgs['adminID'] = Admin.pk
|
|
||||||
extraArgs['WPid'] = wpsite.pk
|
|
||||||
extraArgs['Backuptype'] = Backuptype
|
|
||||||
extraArgs['BackupDestination'] = "SFTP"
|
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
elif config.timeintervel == function:
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
#al = float(Currenttime) - float(21600)
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
#if float(al) >= float(Lastrun):
|
||||||
if status == 1:
|
|
||||||
filename = msg
|
extraArgs = {}
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
extraArgs['adminID'] = Admin.pk
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
extraArgs['WPid'] = wpsite.pk
|
||||||
command = f"rm -r {filename}"
|
extraArgs['Backuptype'] = Backuptype
|
||||||
ProcessUtilities.executioner(command)
|
extraArgs['BackupDestination'] = "SFTP"
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
config.id)
|
if status == 1:
|
||||||
command = f"rm -r {filename}"
|
filename = msg
|
||||||
ProcessUtilities.executioner(command)
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
obj.lastrun = time.time()
|
command = f"rm -r {filename}"
|
||||||
obj.save()
|
ProcessUtilities.executioner(command)
|
||||||
elif config.timeintervel == "1 Week":
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
al = float(Currenttime) - float(604800)
|
obj.lastrun = time.time()
|
||||||
if float(al) >= float(Lastrun):
|
obj.save()
|
||||||
extraArgs = {}
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
extraArgs['adminID'] = Admin.pk
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
extraArgs['WPid'] = wpsite.pk
|
config.id)
|
||||||
extraArgs['Backuptype'] = Backuptype
|
command = f"rm -r {filename}"
|
||||||
extraArgs['BackupDestination'] = "SFTP"
|
ProcessUtilities.executioner(command)
|
||||||
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
|
||||||
|
elif config.timeintervel == function:
|
||||||
|
#al = float(Currenttime) - float(43200)
|
||||||
|
#if float(al) >= float(Lastrun):
|
||||||
|
extraArgs = {}
|
||||||
|
extraArgs['adminID'] = Admin.pk
|
||||||
|
extraArgs['WPid'] = wpsite.pk
|
||||||
|
extraArgs['Backuptype'] = Backuptype
|
||||||
|
extraArgs['BackupDestination'] = "SFTP"
|
||||||
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
|
|
||||||
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
|
if status == 1:
|
||||||
|
filename = msg
|
||||||
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
|
config.id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
|
||||||
|
elif config.timeintervel == function:
|
||||||
|
#al = float(Currenttime) - float(86400)
|
||||||
|
#if float(al) >= float(Lastrun):
|
||||||
|
|
||||||
|
extraArgs = {}
|
||||||
|
extraArgs['adminID'] = Admin.pk
|
||||||
|
extraArgs['WPid'] = wpsite.pk
|
||||||
|
extraArgs['Backuptype'] = Backuptype
|
||||||
|
extraArgs['BackupDestination'] = "SFTP"
|
||||||
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
|
|
||||||
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
|
if status == 1:
|
||||||
|
filename = msg
|
||||||
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
|
config.id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
|
||||||
|
elif config.timeintervel == function:
|
||||||
|
#al = float(Currenttime) - float(259200)
|
||||||
|
#if float(al) >= float(Lastrun):
|
||||||
|
|
||||||
|
extraArgs = {}
|
||||||
|
extraArgs['adminID'] = Admin.pk
|
||||||
|
extraArgs['WPid'] = wpsite.pk
|
||||||
|
extraArgs['Backuptype'] = Backuptype
|
||||||
|
extraArgs['BackupDestination'] = "SFTP"
|
||||||
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
|
|
||||||
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
|
if status == 1:
|
||||||
|
filename = msg
|
||||||
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
|
config.id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
|
||||||
|
elif config.timeintervel == function:
|
||||||
|
#al = float(Currenttime) - float(604800)
|
||||||
|
#if float(al) >= float(Lastrun):
|
||||||
|
|
||||||
|
extraArgs = {}
|
||||||
|
extraArgs['adminID'] = Admin.pk
|
||||||
|
extraArgs['WPid'] = wpsite.pk
|
||||||
|
extraArgs['Backuptype'] = Backuptype
|
||||||
|
extraArgs['BackupDestination'] = "SFTP"
|
||||||
|
extraArgs['SFTPID'] = config.RemoteBackupConfig_id
|
||||||
|
|
||||||
|
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
||||||
|
status, msg, backupID = background.WPCreateBackup()
|
||||||
|
if status == 1:
|
||||||
|
filename = msg
|
||||||
|
if config.RemoteBackupConfig.configtype == "SFTP":
|
||||||
|
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
elif config.RemoteBackupConfig.configtype == "S3":
|
||||||
|
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
||||||
|
config.id)
|
||||||
|
command = f"rm -r {filename}"
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||||
|
obj.lastrun = time.time()
|
||||||
|
obj.save()
|
||||||
|
|
||||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
|
||||||
background = ApplicationInstaller('WPCreateBackup', extraArgs)
|
|
||||||
status, msg, backupID = background.WPCreateBackup()
|
|
||||||
if status == 1:
|
|
||||||
filename = msg
|
|
||||||
if config.RemoteBackupConfig.configtype == "SFTP":
|
|
||||||
IncScheduler.SendTORemote(filename, config.RemoteBackupConfig_id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
elif config.RemoteBackupConfig.configtype == "S3":
|
|
||||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID,
|
|
||||||
config.id)
|
|
||||||
command = f"rm -r {filename}"
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
|
||||||
obj.lastrun = time.time()
|
|
||||||
obj.save()
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
print("Error in Sites:%s" % str(msg))
|
print("Error in Sites:%s" % str(msg))
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user