Peter
Peter

Reputation: 1931

Centos7 Crontab jobs is not executing periodically

Am using a centos7 VPS server, recently I noticed that my website Crontab is not executing periodically on it own as scheduled. I have list of cron jobs but not of it will execute when the time come, but if I login to my CWP web panel and manually click run it will execute my command successfully.

Please how do I fix my Crontab issue?

enter image description here

0 0,12 * * * rm -rf /home/www/temp/*

* * * * * /usr/local/bin/php /home/www/public_html/debug/cron.php >> /home/www/public_html/debug/_exec.log 2

In php cron.php

<?php 
 echo "Received Debugging Request";
?>

Upvotes: 1

Views: 795

Answers (1)

aldegalan
aldegalan

Reputation: 502

Well, as I think, the crontab that is already configured should be changed to something like this:

1 0,12 * * * rm -rf /home/www/temp/*

Why is that?

Because the current configuration 0 0,12 * * * rm -rf /home/www/temp/* means:

At minute 0 past hour 0 and 12.

is probably avoiding 00:00 and 12:00 because the condition says that it must execute after 00 and 12, it should be executed at 00:01 and 12:01.

Upvotes: 1

Related Questions