Cron job not working

hello,
can anyone help me pls the cron jobs i created using cyperbanel add cron isn’t working!
i am a noob in all this with no previous coding or programing knowledge i am just using cyberpanel for hosting my one WordPress site and followed the guides to disable wordpress cron and then setting a cron using cyberpanel but it simply not working, i tried following some guides but it didn’t help and i am sure it’s because my lack of knowledge.
but my litespeedcahce plugin showing last cron run since 2 hours with 501 critical css request in queue, although i set the cron to run every 1 minute ?!
here is the commands i used cd /home/mydomain.com/public_html; php -q wp-cron.php
and then i tried wget -q -O /dev/null https://mydomain.com/wp-cron.php?doing_wp_cron”
but nothing worked.
so what am i messing is the lightspeed cache plugin notification a solid proof that my cron not working or am i wrong ?
thanks in advance.

test with simple one

cron - Verify if crontab works - Ask Ubuntu

1 Like

hello,
first thanks a lot for your fast reply.
second, i used the code from the guide you gave and that was the result

so dose that mean it work every minute as i set it from cyberpanel ? and i have 2 cron jobs for the same function as i said above which command is right to keep and delete the other ?

can you paste the crontab -l here ?

note: when i tried to crontab -l while i was logged in with my website user who has sudo privileges’ it gave this error “/var/spool/cron: chdir: permission denied” i don’t know if this matters but maybe it dose :slight_smile:

and a side question if you may allows it:
do you think it’s good that i made my website user a sudo ? i just tried it because i thought it may be the problem causing the cron not working ? or it is a security problem ?!

sorry for late respond

sudo su -
not sudo crontab…

im not master but i will try

dunno

i always login using regular user
then type sudo su -
(using - ) i forgot the different between su … sudo su … and sudo su -
but i always use sudo su -
and my regular user have sudoers access so only need sudo su - without password

im the stupid person that never care about security
because
more security will make more trouble to me…

if someone hack my server i just need restore my 6 hours backup
and of course every 3-5 days i always apt-get update upgrade without distupgrade