From 29395ab65aa5b3ffc3a36243ce816e5c66ec5497 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 1 Dec 2019 21:03:54 +0500 Subject: [PATCH] bug fix: remove scheduled backups --- backup/backupManager.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backup/backupManager.py b/backup/backupManager.py index e419c68dd..43642f046 100755 --- a/backup/backupManager.py +++ b/backup/backupManager.py @@ -757,16 +757,19 @@ class BackupManager: findTxt = "" if backupDest == "Home" and backupFreq == "Daily": - findTxt = "0-6" + findTxt = "0 3" elif backupDest == "Home" and backupFreq == "Weekly": - findTxt = "* 3" + findTxt = "0 0" elif backupDest != "Home" and backupFreq == "Daily": - findTxt = "0-6" + findTxt = "0 3" elif backupDest != "Home" and backupFreq == "Weekly": - findTxt = "* 3" + findTxt = "0 0" ### + logging.CyberCPLogFileWriter.writeToFile(findTxt) + logging.CyberCPLogFileWriter.writeToFile(backupFreq) + path = "/etc/crontab" command = "cat " + path @@ -776,7 +779,7 @@ class BackupManager: writeToFile = open(tempCronPath, 'w') for items in output: - if items.find(findTxt) > -1 and items.find("backupScheduleLocal.py") > -1: + if (items.find(findTxt) > -1 and items.find("backupScheduleLocal.py") > -1) or (items.find(findTxt) > -1 and items.find('backupSchedule.py')): continue else: writeToFile.writelines(items + '\n')