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