• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Cron skipping intervals

Jelle_Timmer

Basic Pleskian
Hi all!

For a few days now one of my Plesk Onyx 17.5 servers is having issues with executing it's cronjobs.
My application has a job which is running every minute, but since a couple of days it is skipping every 5th minute.

So it runs every minute of every hour every day, except for .00, .05, .10, .15, etc...

Every non-5th minute the task executes without any issues and manual execution doesn't show errors.

The cron log in /var/log shows the job should've been executed, but when i add a logline for every execution (added &>> /var/www/vhosts/*****.*****.eu/cronlog.log to the cron-command) it doesn't show the 5th minutes.

What i noticed about my logs from yesterday is that, when the job did execute in a 5th minute, it was somewhere in the high 50-seconds in stead of somewhere in the first 15 normally...

The contents of /var/spool/cron/USER
MAILTO=""
* * * * * cd /var/www/vhosts/*****.*****.eu/httpdocs; ./crontasks &>> /var/www/vhosts/*****.*****.eu/cronlog.log

Anyone knows what could be wrong? And better, how to get cron into line again?

Server info:
OS: CentOS 7.5.1804
Plesk: Onyx 17.5.3#55
Fully updated
Script is PHP-cli file, running from PHP 7.1
 
Now, a few days later, the issue is still present, but the skip-interval seems to slowly 'crawl' between minutes.

Not only the server mentioned above, but also other servers are showing this behavior. All are running Plesk 17.5.3#55 with CentOS 7.5.1804.
All called scripts depend on PHP 7.1, installed through Plesk.

I also have some servers running Plesk 17.5 with CentOS 6.9 and PHP 7.1, they don't seem to have this problem.
Also, cronjobs which don't have to execute a PHP-script seem to run as they should, without delays/skipping.

The length of the script doesn't seem to influence the delay/skip, because even a simple script that only echos/logs the current time is impacted.
PHP:
#!/opt/plesk/php/7.1/bin/php
<?php
if(PHP_VERSION_ID > 70000) {
    date_default_timezone_set("Europe/Amsterdam");
}

error_log("Time: ".date("Y-m-d H:i:s"));

exit();
?>

I'm aware this might not be a Plesk-related/caused problem, but maybe someone still has an idea about how to fix it.
 
It's still unclear what caused this issues, but switching back to PHP 7.0 solved the problem. However, it would be nice to be able to keep up with the latest releases.
 
Back
Top