mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
some bug fixes in wp remote backups;
;
This commit is contained in:
@@ -989,10 +989,12 @@ Automatic backup failed for %s on %s.
|
||||
|
||||
Lastrun = config.lastrun
|
||||
Currenttime = float(time.time())
|
||||
if config.timeintervel == "30 Minutes":
|
||||
al = float(Currenttime) - float(1800)
|
||||
if float(al) >= float(Lastrun):
|
||||
|
||||
if config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(1800)
|
||||
#if float(al) >= float(Lastrun):
|
||||
#if 1 == 1:
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1013,16 +1015,19 @@ Automatic backup failed for %s on %s.
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.RemoteBackupConfig.configtype == "S3":
|
||||
IncScheduler.SendToS3Cloud(filename, config.RemoteBackupConfig_id, backupID, config.id)
|
||||
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):
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(3600)
|
||||
#if float(al) >= float(Lastrun):
|
||||
# if 1 == 1:
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1050,9 +1055,11 @@ Automatic backup failed for %s on %s.
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.timeintervel == "6 Hours":
|
||||
al = float(Currenttime) - float(21600)
|
||||
if float(al) >= float(Lastrun):
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(21600)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1080,9 +1087,10 @@ Automatic backup failed for %s on %s.
|
||||
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):
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(43200)
|
||||
#if float(al) >= float(Lastrun):
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1110,9 +1118,11 @@ Automatic backup failed for %s on %s.
|
||||
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):
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(86400)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1140,9 +1150,11 @@ Automatic backup failed for %s on %s.
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.timeintervel == "3 Days":
|
||||
al = float(Currenttime) - float(259200)
|
||||
if float(al) >= float(Lastrun):
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(259200)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1170,9 +1182,11 @@ Automatic backup failed for %s on %s.
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
elif config.timeintervel == "1 Week":
|
||||
al = float(Currenttime) - float(604800)
|
||||
if float(al) >= float(Lastrun):
|
||||
|
||||
elif config.timeintervel == function:
|
||||
#al = float(Currenttime) - float(604800)
|
||||
#if float(al) >= float(Lastrun):
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = Admin.pk
|
||||
extraArgs['WPid'] = wpsite.pk
|
||||
@@ -1200,6 +1214,7 @@ Automatic backup failed for %s on %s.
|
||||
obj = RemoteBackupSchedule.objects.get(pk=config.id)
|
||||
obj.lastrun = time.time()
|
||||
obj.save()
|
||||
|
||||
except BaseException as msg:
|
||||
print("Error in Sites:%s" % str(msg))
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user