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
2,109
580
493
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
17,470
2,843
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
 

eballis

Member
Aug 28, 2023
5
1
3
Panama
cPanel Access Level
Root Administrator
I have the same problem, I tried a lot of suggestions and the result is the same. Cron jobs not run. When I see in vtiger Cron jobs not execute automatic. I need to run the URL /vtigercron.php to refresh my calculations fields.
any idea @cPRex
 

eballis

Member
Aug 28, 2023
5
1
3
Panama
cPanel Access Level
Root Administrator
Great! The first area to check is the /var/log/cron file to confirm that the cron in question is running properly. If not, I would hope that log has additional details about the error with the cron not running at all.
Yes I ran, grep CRON /var/log/cron
Aug 29 19:15:01 vmi1331732 CROND[30688]: (root) CMD (/usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1)
Aug 29 19:16:01 vmi1331732 CROND[30726]: (magcrm) CMD (wget https://x.x.x.x/crm/vtigercron.php)
Aug 29 19:16:01 vmi1331732 CROND[30727]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
Aug 29 19:17:01 vmi1331732 CROND[30836]: (magcrm) CMD (wget https://x.x.x.x/crm/vtigercron.php)
Aug 29 19:17:01 vmi1331732 CROND[30837]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
Aug 29 19:18:01 vmi1331732 CROND[30869]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
Aug 29 19:18:01 vmi1331732 CROND[30870]: (magcrm) CMD (wget https://x.x.x.x/crm/vtigercron.php)
Aug 29 19:19:01 vmi1331732 CROND[30907]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
Aug 29 19:19:01 vmi1331732 CROND[30913]: (magcrm) CMD (wget https://x.x.x.x/crm/vtigercron.php)
Aug 29 19:20:01 vmi1331732 CROND[30939]: (root) CMD (/usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1)
Aug 29 19:20:01 vmi1331732 CROND[30940]: (root) CMD (/usr/local/cpanel/scripts/eximstats_spam_check 2>&1)
Aug 29 19:20:01 vmi1331732 CROND[30941]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Aug 29 19:20:01 vmi1331732 CROND[30943]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
Aug 29 19:20:01 vmi1331732 CROND[30944]: (magcrm) CMD (wget https://x.x.x.x/crm/vtigercron.php)
Aug 29 19:20:01 vmi1331732 CROND[30945]: (root) CMD ( imunify360-agent malware on-demand check-detached > /dev/null 2>&1 || :)
Aug 29 19:21:01 vmi1331732 CROND[31040]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
Aug 29 19:21:01 vmi1331732 CROND[31041]: (magcrm) CMD (wget https://x.x.x.x/crm/vtigercron.php)
......... and more
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Thanks for those details. So the cron is indeed running, but it just doesn't seem to be providing the expected output.

What are you expecting the wget command to do? Generally, a wget just downloads the code of the file to the local directory.
 

eballis

Member
Aug 28, 2023
5
1
3
Panama
cPanel Access Level
Root Administrator
Thanks for those details. So the cron is indeed running, but it just doesn't seem to be providing the expected output.

What are you expecting the wget command to do? Generally, a wget just downloads the code of the file to the local directory.
I tried all options to setup the schedule on cron in cpanel. I need to update some calculations fields and date and my modules on vtiger need to do this with cron.
When I run this URL in a web browser all my data going to update so I need to run this URL or file vtigercron.php with cron to get a automatic update of my fields.

see the attach files before and after run the url in the web browser.
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Visiting the site in a browser isn't going to be the same as using wget. It looks like you may need your authentication to be added in the URL as outlined here:


but doing this with a tool like "curl" instead of "wget" is likely the better option.

Ultimately, this would be a question for vtiger as they know what the requirements are to get that software to run properly.
 

eballis

Member
Aug 28, 2023
5
1
3
Panama
cPanel Access Level
Root Administrator
Visiting the site in a browser isn't going to be the same as using wget. It looks like you may need your authentication to be added in the URL as outlined here:


but doing this with a tool like "curl" instead of "wget" is likely the better option.

Ultimately, this would be a question for vtiger as they know what the requirements are to get that software to run properly.
Thanks, I will try with Curl....
Vtiger have a option to check the requirements and all are in green agree to run properly, When I have any problem around permissions or versions, the result of run vtigercron.php file from web browser never update the fields and sen a message of invalid or access denied.
 
  • Like
Reactions: cPRex