bug fix: cron path for ubuntu

This commit is contained in:
Usman Nasir
2020-02-11 21:33:20 +05:00
parent d7b766cd82
commit 0d54457db1
2 changed files with 11 additions and 5 deletions

View File

@@ -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)