Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to prevent cron from emailing protected directory pw

Discussion in 'General Discussion' started by naplandgames, Aug 20, 2016.

Tags:
  1. naplandgames

    naplandgames Registered

    Joined:
    Aug 20, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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!
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,435
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. naplandgames

    naplandgames Registered

    Joined:
    Aug 20, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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!
     
  4. naplandgames

    naplandgames Registered

    Joined:
    Aug 20, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    US
    cPanel Access Level:
    Root Administrator
    Seems to work fine, but (of course) no longer can I get stats from curl. Oh well. Good enough! Thanks again!
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice