Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 5 of 5

This is a discussion on htpasswd and cron job in the Shared & Semi-Dedicated forum
How would l set up my cron job, on a file that is htpasswd protected, if it's at all possible. Thanks Cron output: Code: <!DOCTYPE ...

  1. #1
    JPC Senior Member
    Join Date
    Nov 2003
    Posts
    73

    htpasswd and cron job

    How would l set up my cron job, on a file that is htpasswd protected, if it's at all possible. Thanks

    Cron output:
    Code:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>401 Authorization Required</TITLE>
    </HEAD><BODY>
    <H1>Authorization Required</H1>
    This server could not verify that you
    are authorized to access the document
    requested.  Either you supplied the wrong
    credentials (e.g., bad password), or your
    browser doesn't understand how to supply
    the credentials required.<P>
    <P>Additionally, a 404 Not Found
    error was encountered while trying to use an ErrorDocument to handle the request.
    <HR>
    <ADDRESS>Apache/1.3.29 Server at www.tdtcoalition.net Port 80</ADDRESS>
    </BODY></HTML>
    ~JSlime

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Try using http://username:password@www.whatever.com as the URL that you pass to cron. Alternatively, code your script so that it doesn't need to be called via a URL. CRON was designed to run programs that reside locally on a computer, not to fetch web pages. With what's probably a few simple changes to the script you won't have to call it by URL so you won't have to have it in a web-accessible location, and you won't have to worry about password protecting it.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    JPC Senior Member
    Join Date
    Nov 2003
    Posts
    73
    Thanks once again Jason...

    To be honest with you, I'm not exactly sure what changes l would need to make to make my script work in the way that you're talking about. I have faith in the htpasswd protection.

    ~JSlime

  4. #4
    JPC Senior Member
    Join Date
    Nov 2003
    Posts
    73
    One other quick cron question...

    Can l put multiple e-mail addresses in the cron output box, and seperate them by a coma?

    ~JSlime

  5. #5
    CTO JPC-Masood's Avatar
    Join Date
    Aug 2002
    Location
    Jaguar Servers
    Posts
    2,070
    You can use wget with password to access a password protected script. e.g.

    /usr/bin/wget --http-user=masood --http-passwd=masood --output-document=/home/masood/cron/test.txt http://some_password_protected_.....php

    (all in one line)

    For emails, yes you can try using comma separated emails. I believe it should work. Or you can try emailing from within the script.

    Masood N. | Chief Technical Officer
    JaguarPC.com


    Helpful Links
    Knowledge Base | Network Status

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •