The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  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