Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2003
    Location
    tail -f /var/log/nerd
    Posts
    318

    Question Cron Job Question...

    Hi everyone... I just installed a script for a customer and I can not get the cron job to run. I know cron on the server is working just fine so it is not a problem with cron.

    I think it is a problem with the commands I am using. Below are two pairs of commands I have in crontab but for some reason it is not running the two scripts at the specified times... in fact it is not running them at all.

    Can anyone suggest why?

    ---------- METHOD 1 THAT I TRIED ------------

    @hourly GET http://www.XXXX.com/cgi-bin/arp3/arp3-auto.pl

    @daily GET http://www.XXXX.com/cgi-bin/arp3/arp3-report.pl

    ---------- METHOD 2 THAT I TRIED ------------

    @hourly /home/www/www.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null 2>&1

    @daily /home/www/www.XXXX.com/cgi-bin/arp3/arp3-report.pl > /dev/null 2>&1

    ---------------------------

    Neither of the above worked....

    Suggestions?

    Thanks in advance,

    C
    Mega Hosters Inc. - The Last Host You Will Ever Need!
    Hsphere Control Panel, 24/7 Phone Support, EasyApp, Shared SSL, Daily Backups, Dedicated IPs, PHP4 & PHP5, FFMPEG, Legal Adult Content Allowed + More!
    Treating A Customer The Way They Should Be Treated For Over 5.5 Years Now!

  2. #2
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,560
    hi,

    try

    10 * * * * /hourlyscript
    10 10 * * * /dailyscript

    if you can run the script from teh cmdline, then you'll be able to add it to cron

  3. #3
    Join Date
    Dec 2003
    Location
    Earth
    Posts
    144
    First, does the script run by itself? (without using cron to execute it)

    ---------- METHOD 1 THAT I TRIED ------------

    @hourly GET http://www.XXXX.com/cgi-bin/arp3/arp3-auto.pl

    @daily GET http://www.XXXX.com/cgi-bin/arp3/arp3-report.pl

    ---------- METHOD 2 THAT I TRIED ------------

    @hourly /home/www/www.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null 2>&1

    @daily /home/www/www.XXXX.com/cgi-bin/arp3/arp3-report.pl > /dev/null 2>&1

    ---------------------------
    if($php !== $javascript){
    echo "Good it's not supposed to be";
    }

  4. #4
    Join Date
    Mar 2003
    Location
    tail -f /var/log/nerd
    Posts
    318
    Yes it does... If I trigger the script it works fine.

    Even when I use Webmin on the server and select the cron job and say RUN NOW it WILL run the job.

    Still not understanding why it won't work.

    C
    Mega Hosters Inc. - The Last Host You Will Ever Need!
    Hsphere Control Panel, 24/7 Phone Support, EasyApp, Shared SSL, Daily Backups, Dedicated IPs, PHP4 & PHP5, FFMPEG, Legal Adult Content Allowed + More!
    Treating A Customer The Way They Should Be Treated For Over 5.5 Years Now!

  5. #5
    Join Date
    Dec 2003
    Location
    Earth
    Posts
    144
    so what does "crontab -l" output?
    if($php !== $javascript){
    echo "Good it's not supposed to be";
    }

  6. #6
    Join Date
    Mar 2003
    Location
    South Bend, Indiana, USA
    Posts
    320
    What about using the time and then the full path not using http in the path?

    Something like /home/user/public_html/cgi-bin/arp3/arp3-auto.pl ?
    Daniel
    WLScripting.com - php scripts and tutorials

  7. #7
    Join Date
    Mar 2003
    Location
    tail -f /var/log/nerd
    Posts
    318
    Originally posted by WLHosting
    What about using the time and then the full path not using http in the path?

    Something like /home/user/public_html/cgi-bin/arp3/arp3-auto.pl ?
    ok.. Go back up... Look at the 2nd method I tried.

    C
    Mega Hosters Inc. - The Last Host You Will Ever Need!
    Hsphere Control Panel, 24/7 Phone Support, EasyApp, Shared SSL, Daily Backups, Dedicated IPs, PHP4 & PHP5, FFMPEG, Legal Adult Content Allowed + More!
    Treating A Customer The Way They Should Be Treated For Over 5.5 Years Now!

  8. #8
    0 * * * * /home/xxxx/.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null

    Is the correct format for the hourly CRON. Assuming you are using Cpanel to input the job. Not sure about other control panel formats.

    0 0 * * * /home/xxxx/xxxx.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null

    Is correct for the daily job.

    Hope this helps

    Jeff

  9. #9
    Join Date
    Mar 2003
    Location
    tail -f /var/log/nerd
    Posts
    318
    Thanks Jeff, I'll give that a shot.

    We are not using cpanel on that server but it does not matter anyway as a cronjob is a cronjob. For this particular dedicated server we just enter it in to the crontab file directly.

    crontab -e

    I'll give it a go and report back when I get time.

    Thanks,

    C
    Mega Hosters Inc. - The Last Host You Will Ever Need!
    Hsphere Control Panel, 24/7 Phone Support, EasyApp, Shared SSL, Daily Backups, Dedicated IPs, PHP4 & PHP5, FFMPEG, Legal Adult Content Allowed + More!
    Treating A Customer The Way They Should Be Treated For Over 5.5 Years Now!

Posting Permissions

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