usman@cyberpersons.com
2023-03-26 13:24:45 +05:00

View File

@@ -492,12 +492,13 @@ class IncScheduler(multi.Thread):
if destinationConfig['type'] == 'local': if destinationConfig['type'] == 'local':
if jobConfig[IncScheduler.frequency] == type:
finalPath = '%s/%s' % (destinationConfig['path'].rstrip('/'), currentTime) finalPath = '%s/%s' % (destinationConfig['path'].rstrip('/'), currentTime)
command = 'mkdir -p %s' % (finalPath) command = 'mkdir -p %s' % (finalPath)
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
if jobConfig[IncScheduler.frequency] == type:
### Check if an old job prematurely killed, then start from there. ### Check if an old job prematurely killed, then start from there.
try: try:
oldJobContinue = 1 oldJobContinue = 1
@@ -600,16 +601,19 @@ Automatic backup failed for %s on %s.
backupjob.config = json.dumps(jobConfig) backupjob.config = json.dumps(jobConfig)
backupjob.save() backupjob.save()
else: else:
if jobConfig[IncScheduler.frequency] == type:
import subprocess import subprocess
import shlex import shlex
finalPath = '%s/%s' % (destinationConfig['path'].rstrip('/'), currentTime) finalPath = '%s/%s' % (destinationConfig['path'].rstrip('/'), currentTime)
command = "ssh -o StrictHostKeyChecking=no -p " + destinationConfig[ command = "ssh -o StrictHostKeyChecking=no -p " + destinationConfig[
'port'] + " -i /root/.ssh/cyberpanel " + destinationConfig['username'] + "@" + destinationConfig[ 'port'] + " -i /root/.ssh/cyberpanel " + destinationConfig['username'] + "@" + \
destinationConfig[
'ip'] + " mkdir -p %s" % (finalPath) 'ip'] + " mkdir -p %s" % (finalPath)
subprocess.call(shlex.split(command)) subprocess.call(shlex.split(command))
if jobConfig[IncScheduler.frequency] == type:
### Check if an old job prematurely killed, then start from there. ### Check if an old job prematurely killed, then start from there.
# try: # try:
# oldJobContinue = 1 # oldJobContinue = 1