bug fix: cron

This commit is contained in:
Usman Nasir
2020-03-25 12:39:36 +05:00
parent db17cd1dd3
commit f71e052742
2 changed files with 7 additions and 4 deletions

View File

@@ -70,6 +70,8 @@ class CronUtil:
counter = counter + 1
writeToFile.close()
print("1," + removedLine)
except BaseException as msg:
print("0," + str(msg))
@@ -85,10 +87,6 @@ class CronUtil:
with open(cronPath, "a") as file:
file.write(finalCron + "\n")
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
command = 'chmod 600 %s' % (cronPath)
ProcessUtilities.executioner(command)
print("1,None")
except BaseException as msg:
print("0," + str(msg))

View File

@@ -1604,6 +1604,11 @@ class WebsiteManager:
execPath = execPath + " addNewCron --externalApp " + website.externalApp + " --finalCron '" + finalCron + "'"
output = ProcessUtilities.outputExecutioner(execPath, website.externalApp)
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
command = 'chmod 600 %s' % (cronPath)
ProcessUtilities.executioner(command)
CronUtil.CronPrem(0)
if output.find("1,") > -1: