diff --git a/plogical/cronUtil.py b/plogical/cronUtil.py index 741823f80..ed52e45af 100755 --- a/plogical/cronUtil.py +++ b/plogical/cronUtil.py @@ -77,9 +77,12 @@ class CronUtil: @staticmethod def addNewCron(externalApp, finalCron): try: - CronPath = '/var/spool/cron/%s' % (externalApp) + if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + cronPath = "/var/spool/cron/" + externalApp + else: + cronPath = "/var/spool/cron/crontabs/" + externalApp - with open(CronPath, "a") as file: + with open(cronPath, "a") as file: file.write(finalCron + "\n") print("1,None") diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index d779ce7c3..7f2dfa613 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -1548,11 +1548,14 @@ class WebsiteManager: website = Websites.objects.get(domain=self.domain) - CronPath = '/var/spool/cron/%s' % (website.externalApp) + if ProcessUtilities.decideDistro() == ProcessUtilities.centos: + cronPath = "/var/spool/cron/" + website.externalApp + else: + cronPath = "/var/spool/cron/crontabs/" + website.externalApp - commandT = 'touch %s' % (CronPath) + commandT = 'touch %s' % (cronPath) ProcessUtilities.executioner(commandT, 'root') - commandT = 'chown %s:%s %s' % (website.externalApp, website.externalApp, CronPath) + commandT = 'chown %s:%s %s' % (website.externalApp, website.externalApp, cronPath) ProcessUtilities.executioner(commandT, 'root') CronUtil.CronPrem(1)