How to prevent cron from emailing protected directory pw

naplandgames

Registered
Aug 20, 2016
3
0
1
US
cPanel Access Level
Root Administrator
We have cron run scripts that are in some protected directories (htaccess basic auth). When cron sends out the email for these jobs it also sends out the PW and username since it has to be included in the curl command. Is there a way to prevent this or do I need to silence cron to dev null and just write my own email results (which is too bad because I like to see all of the cron stats).
Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Are you able to run the script directly instead of using cURL to access the script (e.g. "php /path/to/file.php")? If so, you should be able to skip the authentication requirement.

Thank you.
 

naplandgames

Registered
Aug 20, 2016
3
0
1
US
cPanel Access Level
Root Administrator
Thank you, that should work. Last time we tried running php (vs curl) from cPanel cron they never ran. No clue why. These run from bash just fine so I'll give it a go.
Thanks again!