diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index f988fd75c..e58d9fe23 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -265,10 +265,11 @@ class backupSchedule: try: if os.path.exists(backupSchedule.runningPath): + pid = open(backupSchedule.runningPath, 'r').read() output = ProcessUtilities.outputExecutioner('ps aux') - if output.find('/usr/local/CyberCP/plogical/backupSchedule.py') > -1: + if output.find('/usr/local/CyberCP/plogical/backupSchedule.py') > -1 and output.find(pid) > -1: pid = open(backupSchedule.runningPath, 'r').read() print( '\n\nRemote backup is already running with PID: %s. If you want to run again kindly kill the backup process: \n\n kill -9 %s.\n\n' % ( diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 32b379757..345d7b610 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -30,9 +30,9 @@ class backupScheduleLocal: if os.path.exists(backupScheduleLocal.runningPath): output = ProcessUtilities.outputExecutioner('ps aux') + pid = open(backupScheduleLocal.runningPath, 'r').read() - if output.find('/usr/local/CyberCP/plogical/backupScheduleLocal.py') > -1: - pid = open(backupScheduleLocal.runningPath, 'r').read() + if output.find('/usr/local/CyberCP/plogical/backupScheduleLocal.py') > -1 and output.find(pid) > -1: print('\n\nLocal backup is already running with PID: %s. If you want to run again kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid)) return 0 else: