Skip to content
Permalink
Browse files
bug fix cron on ubuntu
  • Loading branch information
usmannasir committed Mar 25, 2020
1 parent 595fc6f commit db17cd1dd3f0b39a8ea7836ff3692bb1bd7a603d
Showing 3 changed files with 13 additions and 0 deletions.
@@ -1702,6 +1702,11 @@ def setup_cron(self):
cronFile.write(content)
cronFile.close()

if not os.path.exists(CentOSPath):
command = 'chmod 600 %s' % (cronPath)
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)


if self.distro == centos or self.distro == cent8:
command = 'systemctl restart crond.service'
else:
@@ -85,6 +85,10 @@ def addNewCron(externalApp, finalCron):
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))
@@ -2133,6 +2133,10 @@ def runSomeImportantBash():
writeToFile.write(content)
writeToFile.close()

if not os.path.exists(CentOSPath):
command = 'chmod 600 %s' % (cronPath)
Upgrade.executioner(command, 0)

@staticmethod
def upgrade(branch):

0 comments on commit db17cd1

Please sign in to comment.