Quadra Hosting Forums  

Go Back   Quadra Hosting Forums > Programming and Scripting > PHP Programming Forum

Reply
 
Thread Tools Display Modes
  #1  
Old 26-03-2009, 08:47 PM
Neil Neil is offline
Junior Member
 
Join Date: Dec 2005
Posts: 5
Neil is on a distinguished road
Question Crontab duplication php mysql

I have a php script that processes text files which ads and updates records in a mysql database.
After January 09 when this file has run automatically by crontab it seems to run twice, but the 2nd time it runs, it runs with incomplete information, so it should not have run because that info is required for the file to run.
In other word it seems to be processing the same file twice at the same time

I can run this file over and over again manually and it runs fine.

I have another php script that has caused problems since 10/08
It adds and updates records to a mysql database, when it was running by cron it sometimes added two records in middle of a loop.
Since I have run this script manually for the last 2 months it has worked fine.
I ran it by cron for a couple of days and it added the duplicates.

Does anyone know what could be causing this?
any suggestion apreciated!
Thanks, neil
Reply With Quote
  #2  
Old 04-06-2009, 08:40 PM
Neil Neil is offline
Junior Member
 
Join Date: Dec 2005
Posts: 5
Neil is on a distinguished road
Default

I may have found the answer
I am running the php file with wget
I have changed the crontab entry from

/usr/local/bin/wget -q /dev/null http://www.foo.com.au/file.php

to

/usr/local/bin/wget --ignore-length -q http://www.foo.com.au/file.php

on initial testing this has stopped the duplication

below is the info on "ignore length".
If anyone from quadra has any knowledge of this or could confirm or deny that this could be the cause of my problem please reply.
thanks, Neil

‘--ignore-length’
Unfortunately, some http servers (cgi programs, to be more precise) send out bogus Content-Length headers,
which makes Wget go wild, as it thinks not all the document was retrieved. You can spot this syndrome if
Wget retries getting the same document again and again, each time claiming that the (otherwise normal)
connection has closed on the very same byte.

With this option, Wget will ignore the Content-Length header—as if it never existed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 09:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright© Quadra Hosting