Reputation: 1931
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?
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
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