SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I'd be really greatful if anyone could advise me on a cron job I have set up. I believe that the 'job' are not working as I wish and would therefore like any input.

    The Cron Job simple calls a php page, which is plain html with with various php scripts called by include();. The php scripts check the modified time of various flat files, and if they are out of date it fetches new data and overwrites the old files (if 'indate' the flat files are just included().

    I wish to have a cron job running so that the files are never out of date - to prevent the slow loading due to fetching new data.

    Basically what I want is to replicate a user calling this page ever hour. So after reading on the board I set up the cron job:
    php /home/username/public_html/folder1/folder2/file.php > /dev/null

    However, for some reason I don't think that I am getting the desired effect - ie new data being fetched and old data over written.

    So either the page is not being called by Cron, or Cron is not replicating what would occur if a user called the page.

    I wrote to HostRocket to ask them if the Jobs were being executed, who advised the the logs showed that they where. However they also advised :

    "I would suggest using /usr/bin/php instead of just php, so the server knows the exact location."

    So my two Questions are:

    Why use /usr/bin/php when the full path has been specified ?

    In my case should Cron be replicating a user calling my page - could it be that Cron is binning the output rather than writing it to a file?

    Please Help - its doing my nut!!

  2. #2
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand you correct, your problem is that your cron job has no effect. If so, welcome to the club, I have the same problem since some weeks. You can have a look at this thread here, maybe it will help you.
    http://www.sitepointforums.com/showt...highlight=cron

  3. #3
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, seems to be - according to HostRoacket the Crons are running but they don't seem to be executing the script the same as a user from a browser would.

    Any idea on the 2 QU's in my initial post?

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    The crons are running at HostRocket, if you send in a trouble ticket again and ask for Peter to answer it then they can get it sortted out for you.

    I'm sure it may be just one thing wrong that they can get sorted out.

    -Pete


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
  •