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.

Simple CRONTAB Won't execute or send error to email

Discussion in 'E-mail Discussions' started by markbad311, Sep 9, 2007.

  1. markbad311

    markbad311 Member

    Joined:
    Sep 9, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi guys having a little problem with setting up some crontabs. I set up a test one.

    CRONTAB:
    Code:
    */5 *  *  *  *  /usr/local/bin/php  /home/eriebusi/public_html/quickleadconnect/Scripts/test.php
    
    EXECUTING PHP:
    PHP:
    <?php
    //GLOBAL INCLUDES////////////////////
    require('funcs.php');
    require(
    'errors.php');
    //END GLOBAL INCLUDES////////////////    
        
    $sql "INSERT INTO `tracking` (`TrackID`, `SysID`, `AppID`, `EID`, `TrackType`, `TrackDate`) VALUES('', '0', '0', '0', '99', NOW())";
        
    $result mysql_query($sql) or die(LogError('test.php Line 21: '.mysql_error(),$sql));
    ?>
    in the tracking table no rows are inserted after 12 hours of checking. The script executes and insterts if I just connect to it. (QuickLeadConnect is a subdomain/addon domain.)
     

    Attached Files:

  2. markbad311

    markbad311 Member

    Joined:
    Sep 9, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Bump. Please help guys this has been racking my brain for 5 days.

    Do I need to tell it where php is?
    Does it have to be run like it is executing on the command line?
    Can I run it with some kind of parameter to help troubleshoot this?


    Thank you in advanced.
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    It's possibly dying on the requires, which then cause the rest of the script to fail. Since your require statements are using relative patchs, PHP will look for those scripts relative to the current directory. When executed via cron, you need to either have the script cd to the proper directory, or provide full paths to the required files.
     
  4. markbad311

    markbad311 Member

    Joined:
    Sep 9, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Idk???

    it is still not executing or throwing an error in to the error log. Also it is not sending me an e-mail. What can I do to throw an error so I at least know CRON is working?
     
  5. markbad311

    markbad311 Member

    Joined:
    Sep 9, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    PHP:
    <?php
        $sql 
    "INSERT INTO `tracking` (`TrackID`, `SysID`, `AppID`, `EID`, `TrackType`, `TrackDate`) VALUES('', '0', '0', '0', '99', NOW())";
        
    $result mysql_query($sql) or die('test.php Line 32: '.mysql_error());
    ?>
     
    #5 markbad311, Sep 11, 2007
    Last edited: Sep 11, 2007
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Change your require directives to this:

    Code:
    require('/home/eriebusi/public_html/quickleadconnect/Scripts/funcs.php');
    require('/home/eriebusi/public_html/quickleadconnect/Scripts/errors.php');
    
     
  7. markbad311

    markbad311 Member

    Joined:
    Sep 9, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    well turned out it was something to do with my web host. They don't allow me to shell/telenet so I can't configure my own job manually. I had a support ticket with my web host and they looked in to it. After some litigation of and about two weeks they had finally got to the bottom of it and all the scripts were executing just fine. I went in and changed the intervals that they executed in to every 30 minutes and an hour and blam they all stopped working again.

    Something is different or wrong with the way cPanel thinks it supposed to configure jobs and the way they have to be done on the server. Can you give me any inclination to what they may be?

    (btw the current requires worked fine)

    Thanks in Advanced
     
Loading...
Similar Threads - Simple CRONTAB Won't
  1. Markqz
    Replies:
    1
    Views:
    138

Share This Page