Concrete5 Job via CRON access denied
PermalinkI'm attempting to run a C5 job through CRON. I'm using a wget command to the URL provided in the C5 admin. However, when I test the command via SSH through the terminal, I get "Access Denied" because the "C5_EXECUTE" variable is not set. As far as I understand, this variable is set when you log into C5 but how am I supposed to ensure these variables are set, etc. if I'm executing through CRON?
I was using lynx instead of wget to run sitemap generator, e.g.:
lynx -dump http://domain.tld/index.php/tools/required/jobs/run_single?auth=15746f3ba67718f29e4720d2b030f3af&jID=3
This gave 'Access denied' as you had found. But the problem was that the URL parameter needed to be wrapped in quotes, thus:
lynx -dump "http://domain.tld/index.php/tools/required/jobs/run_single?auth=15746f3ba67718f29e4720d2b030f3af&jID=3"
This produced the expected result and worked. The reason the first example did not work is due to the
&jID=3
The other suggested solution to create a command line entry point to C5 is valid and useful, but probably overkill for this particular failure mode.
Hope this helps others with this 'Access denied' issue.
Thanks for your reply. I found this:
http://www.concrete5.org/documentation/how-tos/developers/using-con...
And it works!
I'm still having this issue. When I visit the CRON job URL in my web browser I'm able to have it run. However, when I use an actual command via terminal or through CRON itself I get "Access Denied" because C5_EXECUTE is not defined.
Curious if anyone else has ran into this.