PHP CLI cron job not working
Permalink
I've tried setting up a cron job as shown in this howto:http://www.concrete5.org/documentation/how-tos/developers/using-con...
When I run the file directly from the command line, it works fine.
However if I put it in a cron job like this:
, it fails to run and logs a warning "Access denied. CLI only".
How do I run it as a cron job?
When I run the file directly from the command line, it works fine.
However if I put it in a cron job like this:
10 19 * * * /usr/bin/php /home/xyzacc/public_html/cli/myjob.php >> home/xyzacc/public_html/cli/myjob.log
How do I run it as a cron job?
I tried wget in cron but it's not working.
I even tried wget and curl in command line and both of them are giving me Access Denied warning:
Is there something else I need to do to make this work?
I even tried wget and curl in command line and both of them are giving me Access Denied warning:
wget http://www.mysite.com/index.php/tools/required/jobs/run_single?auth=217d9d6725d415507bcb19faf64d615e&jID=3 curl http://www.mysite.com/index.php/tools/required/jobs/run_single?auth=217d9d6725d415507bcb19faf64d615e&jID=3
Is there something else I need to do to make this work?
You need to wrap the URLs into quotes since they contain ampersands.
Oh yes. That works now.
Also thanks for the scripts.
Also thanks for the scripts.
Alternatively, we have some command line tools that allow you to run these scripts straight from command line within the concrete5 context. I just put them to github, you can find them here:
https://github.com/ahukkanen/c5_cmd...
The wget method should serve most situations. The command line tools were initially for scripts that take or might take a long time, like importing 100s of thousands of database entries.