Jump to content

Recommended Posts

Posted

Hi tech support, 

 

could you help me check if I setup the cron job correctly? I don't receive any emails from the output of the scrip so I am wondering if it runs at all. 

 

I set a gmail email in the cron job panel and the cron job frequency set to once per day. The command filled with the following: 

 

/usr/local/bin/php /home/ckuo/public_html/div_radar/tools/updateStocks.php

 

 

Thanks!

post-183397-0-35616300-1581436755_thumb.png

Posted

Your command is wrong.

 

Try this (assuming PHP 5.6 is the desired PHP version). Note that if the script doesn't produce any output, no email will be sent.

ea-php56 -q /home/ckuo/public_html/div_radar/tools/updateStocks.php 2>&1

If your script produces output but you still prefer not to receive the emails containing it:

ea-php56 -q /home/ckuo/public_html/div_radar/tools/updateStocks.php >/dev/null 2>&1
Posted

/usr/local/bin/php /home/ckuo/public_html/div_radar/tools/updateStocks.php

/usr/local/bin/php should work and on Johnny it's php 7.2

 

Here's the errors your script is showing:

PHP Warning:  fopen(../../cgi-bin/div_radar_cgi/curl_log_updateStocks.txt): failed to open stream: No such file or directory in /home/ckuo/public_html/div_radar/tools/updateStocks.php on line 15
PHP Warning:  curl_setopt(): supplied argument is not a valid File-Handle resource in /home/ckuo/public_html/div_radar/tools/updateStocks.php on line 17

d1 = 2020/02/11
d7 = 2020/02/18
PHP Warning:  fclose() expects parameter 1 to be resource, bool given in /home/ckuo/public_html/div_radar/tools/updateStocks.php on line 25
Posted

Hi, 

 

I've tried the new syntax. I think the cron launches but the script doesn't work for some reason.

 

I noticed that if I run the script on the browser 

http://ckuo.heliohost.org/div_radar/tools/updateStocks.php

It works perfectly, but if the cron runs it, it shows these error logs below. In both cases the script is exactly the same "updateStocks.php"

 

[14-Feb-2020 00:00:23 UTC] PHP Warning: fopen(../../cgi-bin/div_radar_cgi/curl_log_updateStocks.txt): failed to open stream: No such file or directory in /home/ckuo/public_html/div_radar/tools/updateStocks.php on line 15

 
Why isn't fopen able to read the files? 
 
Thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...