Control Web Panel

WebPanel => CentOS-WebPanel Bugs => Topic started by: tester on February 09, 2025, 09:08:57 PM

Title: Cron issue
Post by: tester on February 09, 2025, 09:08:57 PM
Sorry, I really don't know where to post this.

I'm trying to run a cron by pressing the 'run cron job now' button. The script is being executed but the parameters are not being passed. I run the same url in my browser and the parameters are being passed. The cron code looks like:
Code: [Select]
wget https://mysite.com/index.php?route=extension/common/script/cron_reset&reset=manualI'm picking up the parameter in the php script like:
Code: [Select]
$reset = $_GET['reset'];My host doesn't know what's going on as of yet.

Title: Re: Cron issue
Post by: cyberspace on February 09, 2025, 09:10:15 PM
try to change the command of cron to:
Code: [Select]
wget 'https://mysite.com/index.php?route=extension/common/script/cron_reset&reset=manual'
Title: Re: Cron issue
Post by: tester on February 09, 2025, 09:30:12 PM
when I put quotes it doesn't execute the script at all.
Title: Re: Cron issue
Post by: cyberspace on February 09, 2025, 09:38:55 PM
Try to use single (') and double (") quotes.

I think your cron doesn't pass parameters  because the chars like "?", "&" can be recognized as special chars by command line interpreted used by cron. If my guess is correct then you need to put the whole requested URL in quotes or pass the parameters in some other way.
Title: Re: Cron issue
Post by: cyberspace on February 09, 2025, 09:48:49 PM
Also, try to replace 'wget' with 'curl' and see if the problem remains.
Title: Re: Cron issue
Post by: james88 on February 10, 2025, 09:43:46 PM
it works but about what php running the back end some times got to restart it  make it work....