+ Reply to Thread
Results 1 to 4 of 4

Thread: CRON jobs help!!!

  1. #1
    Junior Member arrdb is on a distinguished road
    Join Date
    Sep 2011
    Posts
    9

    CRON jobs help!!!

    I set up a cron job, and it doesn't seem to work.
    So, I set up a test cron - a php which just modifies a text file, to see if it is working, and realised that the cron doesn't run at all.

    The cron command I used is:
    /usr/local/bin/php -f /home/arrdb/public_html/testcron.php

    This is the cron log mail that I got
    Return-path: <arrdb@box8.host1free.com>
    Envelope-to: arrdb@box8.host1free.com
    Delivery-date: Tue, 18 Oct 2011 15:44:01 +0300
    Received: from arrdb by box8.host1free.com with local (Exim 4.72)
    (envelope-from <arrdb@box8.host1free.com>)
    id 1RG91V-0004Tm-Cl
    for arrdb@box8.host1free.com; Tue, 18 Oct 2011 15:44:01 +0300
    Date: Tue, 18 Oct 2011 15:44:01 +0300
    Message-Id: <E1RG91V-0004Tm-Cl@box8.host1free.com>
    From: root@box8.host1free.com (Cron Daemon)
    To: arrdb@box8.host1free.com
    Subject: Cron <arrdb@box8> /usr/local/bin/php -f /home/arrdb/public_html/testcron.php
    Content-Type: text/plain; charset=UTF-8
    Auto-Submitted: auto-generated
    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/home/arrdb>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=arrdb>
    X-Cron-Env: <USER=arrdb>
    Sender: CronDaemon <arrdb@box8.host1free.com>
    Pls help me!
    Last edited by arrdb; 10-20-2011 at 03:13 AM. Reason: The mail text that I pasted looked scrambled. Copy pasting it again.

  2. #2
    Super Moderator Modestas is on a distinguished road Modestas's Avatar
    Join Date
    Jun 2011
    Posts
    1,859

    Re: CRON jobs help!!!

    Hello,

    After investigation i have founded that you have provided wrong path to storeval.txt file. Correct testcron.php file looks like this:

    <?php
    $file=fopen("/home/arrdb/public_html/storeval.txt","r");
    $value = intval(file_get_contents('/home/arrdb/public_html/storeval.txt'));
    fclose($file);
    $value += 1;
    $file=fopen("/home/arrdb/public_html/storeval.txt","w");
    file_put_contents('/home/arrdb/public_html/storeval.txt', $value);
    fclose($file);

    ?>

  3. #3
    Junior Member arrdb is on a distinguished road
    Join Date
    Sep 2011
    Posts
    9

    Re: CRON jobs help!!!

    Oh Thanks a ton!!

    It was so silly of me to ignore that I hadnt specified the absolute path!
    When I executed the php through my browser, it worked... and I assumed it would work with cron too!

    Silly of me!
    Again.. thanx a ton!! and sorry for the trouble!

  4. #4
    Founder CEO Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius has a reputation beyond repute Casius's Avatar
    Join Date
    Apr 2010
    Location
    Around the World :)
    Posts
    1,569

    Re: CRON jobs help!!!

    Hey, thank you for using Host1Free.com. We would be pleased if you refer all of your friend to get signed up to Host1Free.com...because simply, Host1Free.com is just the best free hosting service! Don't you agree with me?
    Free Web Hosting - Host1Free.com
    Premium Paid Web Hosting - Host1Plus.com
    (Get 99% discount for the first month - code 99ALL)

+ Reply to Thread

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34