OlavJ

Registered
Mar 18, 2023
3
0
1
NORWAY
cPanel Access Level
Website Owner
Ok so i am running a store and im using cron jobs to automaticly check a url for new orders but it doesnt work.
When i enter the url manually it works and it registers new orders and assigns them an api, but when i try to use cron jobs nothing happens
This is the command im running: wget --spider -O - http://example/cron/order >/dev/null 2>&1

Ive also tried countless variation but nothing works, like curl http://example.com/cron/order >/dev/null 2>&1
 
Last edited by a moderator:

quietFinn

Well-Known Member
Feb 4, 2006
1,841
426
438
Finland
cPanel Access Level
Root Administrator
In crontab jobs you must use the full path, i.e. /usr/bin/wget
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,239
363
cPanel Access Level
Root Administrator
He's saying for any commands that you use, you need to enter the full path as cron itself doesn't have a PATH directory or a home shell.

I would try using this in the cron command to see if that gives you better results:

Code:
/usr/bin/wget --spider -O - http://example/cron/order >/dev/null 2>&1
If not, you'll need to isolate the issue a bit more by confirming if the cron itself is actually not running through the cron logs, or if the content just isn't working how you expect.
 

OlavJ

Registered
Mar 18, 2023
3
0
1
NORWAY
cPanel Access Level
Website Owner
I tried the new code and it still does not work
The problem is i don't have access to the logs as i dont have a dedicated server, im 99% sure the cron is running as im getting emails when i remove the " >/dev/null 2>&1 "
When i assign order id's manually and enter the "example.com/order" in my browser it successfully assigns order ids so the link is also fine. The cron is just not doing what its supposed to do