As Arnel had mentioned we have a guide for how to setup a cron job
and towards the bottom it talks about when using curl
you need specify a User-Agent
string with the -A
flag like so to avoid ModSecurity
from intercepting the request:
0,30 * * * * curl -A "cPanel CronJob" http://example.com/cron.php
You can put anything between the quotes to name your User-Agent
, and this is what will show up in your access-logs as the User-Agent that sent the request. That way you can differentiate an automated request, from an outside request.
I've gone ahead and done this for you, but feel free to change the name of the User-Agent if you'd like, and let us know if you need anything else!