Cron jobs not working

Hello all,

I face an issue with a cron job I have created in webmin. I have installed wp-cli (wordpress command line tool) in one of my websites. Also I have installed a plugin called wp all import which is making some imports from external xml files. Everything okay. The issue is that my cronjob is not working, even though the same command when I run it manually from cli is perfectly fine. I have tried to add the cron job inside the webmin area, Also added it in crontab -e with vim. I see the logs and I see that the cron exists there but it does not working. I am not sure if it’s a wp-cli issue or the cronjob is not working properly from the webmin settings. I will appreciate some help. Here are the cronjob command and also the log in /var/logs/cron

Jan 13 15:28:01 server CROND[965074]: (root) CMD (root /usr/local/bin/wp --path=/home/elekidis/public_html/ all-import run 2)

28 * * * * root /usr/local/bin/wp --path=/home/elekidis/public_html/ all-import run 2

Also an image of the schedules cron job tab

SYSTEM INFORMATION
OS type and version AlmaLinux 8.8
Webmin version 2.105
Virtualmin version 7.9.0
SYSTEM Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz, 4 cores CLOUD VPS
Related packages SUGGESTED

Since you know the time it runs you could try checking the logs for cron entries. That should probably tell you if it even tries to run.

try changing the line in your cron to read

/usr/local/bin/wp --info

and see if you get any output from the cron job, if you do cron is working correctly & the fault will lie within the plugin. Just a guess, the plugin may be expecting a terminal to write to when with a cron job the terminal environment variable is not set.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.