PHP CLI cron job not working

I've tried setting up a cron job as shown in this howto:

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
, it fails to run and logs a warning "Access denied. CLI only".

How do I run it as a cron job?

View Replies: View Best Answer
Mainio replied on at Permalink Best Answer Reply
You'll need to call the job URLs you can see from the dashboard with wget for instance.

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:

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.
BlueFractals replied on at Permalink Reply
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?
Mainio replied on at Permalink Reply
You need to wrap the URLs into quotes since they contain ampersands.
BlueFractals replied on at Permalink Reply
Oh yes. That works now.
Also thanks for the scripts.