0
votes

I just need to run the following url using cron jobs in my cPanel.

When I am trying to execute the link

http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron

the link is running in browser but when I am tried to add the same URL as it is in cron jobs I am getting the following error

bash/sh/ file not found

and when I edited the cron job as

/usr/bin/php /home/staging/public_html/index.php?option=com_acymailing&ctrl=cron

but I am getting 404 error.

My cPanel username is staging

Can anybody tell me what's the syntax of cron job in cPanel.

Cron Job running every minute and email report showing this errors.

2
Can you check cPanel file manager and confirm the path to index.php is /home/staging/public_html/ ? - sinisterfrog
@sinisterfrog - Yeah, the file is in right location. - Kerry
Also check the route of php by typing which php. - fedorqui 'SO stop harming'

2 Answers

0
votes

Use wget function with full URL.

0
votes

@yannick-blondeau As suggested you can use a wget or curl to make a simple request to your website.

Usually wget will attempt to download a file but this is not necessary with the -O flag to pipe to /dev/null or -q (both options used to prevent from saving output to a file), an example will look like

wget -O /dev/null http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron
wget -q http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron

You can also use curl for the same effect

curl --silent http://www.insidewealth.com.au/index.php?option=com_acymailing&ctrl=cron