Cron jobs not working and not listed — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberHosting

Cron jobs not working and not listed

Provider: Digital Ocean

Virtualization Type: KVM

System: Ubuntu 18.04

Installation option:

OLS or Enterprise?
OLS

Installing from official server or mirror server?
official

Replace JS/CSS files to JS Delivr?
no

Install Memcached extension for PHP?
yes

Install LiteSpeed Memcached?
yes

Install Memcached?
yes

Install Redis extension for PHP?
yes

Install Redis?
yes


Problem:
I added a cron job on the CyberPanel. The job is created to /var/spool/cron/[username], but not appears on the Cyber Panel Cron Management list, and not running.

The command looks like this: php /home/[domain]/public_html/script.php
PHP file owned by user, chmod 777.

Please help! Thanks!

Comments

  • Info: The Cyber Panel is a fresh install, latest version 1.9.2.
  • Someone? Nobody knows the solution? :(
  • If I modify the cronPath on the cronUtil.py, the listing is works fine.

    def getWebsiteCron(externalApp):
    try:

    if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
    cronPath = "/var/spool/cron/" + externalApp
    else:
    cronPath = "/var/spool/cron/crontabs/" + externalApp


    I removed crontabas/ in else branch.

    Now looks like this:
    def getWebsiteCron(externalApp):
    try:

    if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
    cronPath = "/var/spool/cron/" + externalApp
    else:
    cronPath = "/var/spool/cron/" + externalApp

    However, cron tasks will not run.
    What's the real problem? What is not configured well?
  • On AddNewCron function is missing the operating system test on CronPath:

    def addNewCron(externalApp, finalCron):
    try:
    CronPath = '/var/spool/cron/%s' % (externalApp)

    with open(CronPath, "a") as file:
    file.write(finalCron + "\n")
  • This part seems to be quite problematic under Ubuntu.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion