mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
bug fix: cron path for ubuntu
This commit is contained in:
@@ -77,9 +77,12 @@ class CronUtil:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def addNewCron(externalApp, finalCron):
|
def addNewCron(externalApp, finalCron):
|
||||||
try:
|
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")
|
file.write(finalCron + "\n")
|
||||||
|
|
||||||
print("1,None")
|
print("1,None")
|
||||||
|
|||||||
@@ -1548,11 +1548,14 @@ class WebsiteManager:
|
|||||||
|
|
||||||
website = Websites.objects.get(domain=self.domain)
|
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')
|
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')
|
ProcessUtilities.executioner(commandT, 'root')
|
||||||
|
|
||||||
CronUtil.CronPrem(1)
|
CronUtil.CronPrem(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user