[PHP] cron job problem

2012-10-23 Thread Jim Giner
I have a php script that has been triggered by my hoster's cron 
process(?) to run once a day since last March.  It's been running fine - 
and I've made no changes to it.  Suddenly in the last couple of days it 
is running twice it seems.  The whole process sends an email at its 
conclusion and the receipient tells me today that she's getting two 
emails only a minute apart.


Any ideas on why this might happen?  I haven't contact my host company 
yet - thought I'd ask around first.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
 I have a php script that has been triggered by my hoster's cron process(?)
 to run once a day since last March.  It's been running fine - and I've made
 no changes to it.  Suddenly in the last couple of days it is running twice
 it seems.  The whole process sends an email at its conclusion and the
 receipient tells me today that she's getting two emails only a minute apart.

 Any ideas on why this might happen?  I haven't contact my host company yet -
 thought I'd ask around first.

Though not really a PHP question, there are several reasons this
could happen, including a race condition that is being encountered due
to a slowdown of the host system or changes to the system's
environment.  Are the emails she's receiving identical?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread Jim Giner

On 10/23/2012 4:56 PM, Daniel Brown wrote:

On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

I have a php script that has been triggered by my hoster's cron process(?)
to run once a day since last March.  It's been running fine - and I've made
no changes to it.  Suddenly in the last couple of days it is running twice
it seems.  The whole process sends an email at its conclusion and the
receipient tells me today that she's getting two emails only a minute apart.

Any ideas on why this might happen?  I haven't contact my host company yet -
thought I'd ask around first.


 Though not really a PHP question, there are several reasons this
could happen, including a race condition that is being encountered due
to a slowdown of the host system or changes to the system's
environment.  Are the emails she's receiving identical?


Yes - same msg same time

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 4:59 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Yes - same msg same time

If it wouldn't be a problem, can you provide the script here (or
on a site like Pastebin), as well as the crontab time entry for this?
While checking the crontab, make sure a duplicate entry for this
wasn't somehow added.

In the event that you'd like to keep this information from the
archives and general mailing list (and depending on the security
implications based upon what's divulged, I'd recommend it), I invite
you to send it to me privately, off-list, and I'll take a look at it
later tonight or tomorrow morning.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 16:59 -0400, Jim Giner wrote:

 On 10/23/2012 4:56 PM, Daniel Brown wrote:
  On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com 
  wrote:
  I have a php script that has been triggered by my hoster's cron process(?)
  to run once a day since last March.  It's been running fine - and I've made
  no changes to it.  Suddenly in the last couple of days it is running twice
  it seems.  The whole process sends an email at its conclusion and the
  receipient tells me today that she's getting two emails only a minute 
  apart.
 
  Any ideas on why this might happen?  I haven't contact my host company yet 
  -
  thought I'd ask around first.
 
   Though not really a PHP question, there are several reasons this
  could happen, including a race condition that is being encountered due
  to a slowdown of the host system or changes to the system's
  environment.  Are the emails she's receiving identical?
 
 Yes - same msg same time
 


Are they definitely only in the cron list once? Could someone have tried
to help by adding the job into the daily.cron, but forgotten to remove
it from the regular crontab?
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 17:12 -0400, Jim Giner wrote:

 
 
 On 10/23/2012 5:19 PM, Ashley Sheridan wrote:
 
  
  On Tue, 2012-10-23 at 16:59 -0400, Jim Giner wrote: 
  
   On 10/23/2012 4:56 PM, Daniel Brown wrote:
On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner 
jim.gi...@albanyhandball.com wrote:
I have a php script that has been triggered by my hoster's cron 
process(?)
to run once a day since last March.  It's been running fine - and I've 
made
no changes to it.  Suddenly in the last couple of days it is running 
twice
it seems.  The whole process sends an email at its conclusion and the
receipient tells me today that she's getting two emails only a minute 
apart.
   
Any ideas on why this might happen?  I haven't contact my host company 
yet -
thought I'd ask around first.
   
 Though not really a PHP question, there are several reasons this
could happen, including a race condition that is being encountered due
to a slowdown of the host system or changes to the system's
environment.  Are the emails she's receiving identical?
   
   Yes - same msg same time
   
  
  
  Are they definitely only in the cron list once? Could someone have
  tried to help by adding the job into the daily.cron, but forgotten
  to remove it from the regular crontab?
  -- 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
  
  
  
 
 daily.cron?  regular crontab?  Don't know of what you speak.
 
 This is my only cron-initiated task.  My provider gives me a screen to
 enter the command and the desired time to run it and it's been that
 way for months.  I have had no need to change it so I'm surprised this
 is happening.
   


Crontab is the daemon which runs cron jobs, and some distros have set up
special files called cron.daily (or daily.cron I don't recall),
cron.hourly, etc to make it easier to schedule jobs.

As you're entering this through a control panel (presumably a web-based
one?) I would guess that's not the problem. It could be that the
hostings control panel software has had a hiccup?

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] cron job problem

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:


 Crontab is the daemon which runs cron jobs, and some distros have set up
 special files called cron.daily (or daily.cron I don't recall),
 cron.hourly, etc to make it easier to schedule jobs.

Quick clarification and correction here:

The cron *daemon* is crond, while the *script* that is
batch-processed by cron is called the crontab.  When it is executed,
it is referred to as a cron job.

That said, Ash is right about the rest.  Different OS flavors
(BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
different path and file standards.  Linux, in general, uses a command
`crontab` which opens the local user's environment-configured editor
to modify the user's crontab in the spool.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread David OBrien
On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:

 On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
 
 
  Crontab is the daemon which runs cron jobs, and some distros have set up
  special files called cron.daily (or daily.cron I don't recall),
  cron.hourly, etc to make it easier to schedule jobs.

 Quick clarification and correction here:

 The cron *daemon* is crond, while the *script* that is
 batch-processed by cron is called the crontab.  When it is executed,
 it is referred to as a cron job.

 That said, Ash is right about the rest.  Different OS flavors
 (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
 different path and file standards.  Linux, in general, uses a command
 `crontab` which opens the local user's environment-configured editor
 to modify the user's crontab in the spool.

 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


script runs
ntp updates server time
script runs again?


Re: [PHP] cron job problem

2012-10-23 Thread Jim Giner

On 10/23/2012 6:18 PM, David OBrien wrote:

On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:


On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:



Crontab is the daemon which runs cron jobs, and some distros have set up
special files called cron.daily (or daily.cron I don't recall),
cron.hourly, etc to make it easier to schedule jobs.


 Quick clarification and correction here:

 The cron *daemon* is crond, while the *script* that is
batch-processed by cron is called the crontab.  When it is executed,
it is referred to as a cron job.

 That said, Ash is right about the rest.  Different OS flavors
(BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
different path and file standards.  Linux, in general, uses a command
`crontab` which opens the local user's environment-configured editor
to modify the user's crontab in the spool.

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



script runs
ntp updates server time
script runs again?


But why now?  This process has been running just fine for months.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 18:36 -0400, Jim Giner wrote:

 On 10/23/2012 6:18 PM, David OBrien wrote:
  On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:
 
  On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
  a...@ashleysheridan.co.uk wrote:
 
 
  Crontab is the daemon which runs cron jobs, and some distros have set up
  special files called cron.daily (or daily.cron I don't recall),
  cron.hourly, etc to make it easier to schedule jobs.
 
   Quick clarification and correction here:
 
   The cron *daemon* is crond, while the *script* that is
  batch-processed by cron is called the crontab.  When it is executed,
  it is referred to as a cron job.
 
   That said, Ash is right about the rest.  Different OS flavors
  (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
  different path and file standards.  Linux, in general, uses a command
  `crontab` which opens the local user's environment-configured editor
  to modify the user's crontab in the spool.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  script runs
  ntp updates server time
  script runs again?
 
 But why now?  This process has been running just fine for months.
 


Have you tried removing the job entirely from cron and re-adding it? It
might be enough to kick-start the process into behaving.
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] cron job problem

2012-10-23 Thread Jim Giner

On 10/23/2012 6:57 PM, Ashley Sheridan wrote:

On Tue, 2012-10-23 at 18:36 -0400, Jim Giner wrote:


On 10/23/2012 6:18 PM, David OBrien wrote:

On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:


On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:



Crontab is the daemon which runs cron jobs, and some distros have set up
special files called cron.daily (or daily.cron I don't recall),
cron.hourly, etc to make it easier to schedule jobs.


  Quick clarification and correction here:

  The cron *daemon* is crond, while the *script* that is
batch-processed by cron is called the crontab.  When it is executed,
it is referred to as a cron job.

  That said, Ash is right about the rest.  Different OS flavors
(BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
different path and file standards.  Linux, in general, uses a command
`crontab` which opens the local user's environment-configured editor
to modify the user's crontab in the spool.

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



script runs
ntp updates server time
script runs again?


But why now?  This process has been running just fine for months.




Have you tried removing the job entirely from cron and re-adding it? It
might be enough to kick-start the process into behaving.


Yes my host asked me to do that earlier.  And nope - no better.

I have told them it's gotta be something on their end because I tested 
the script from a browser displaying what it was doing and it ran fine. 
 Removed my debug settings and ran it from a browser and again it ran 
fine.  Re-scheduled the cron task and it ran wrong.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 18:51 -0400, Jim Giner wrote:

 On 10/23/2012 6:57 PM, Ashley Sheridan wrote:
  On Tue, 2012-10-23 at 18:36 -0400, Jim Giner wrote:
 
  On 10/23/2012 6:18 PM, David OBrien wrote:
  On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:
 
  On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
  a...@ashleysheridan.co.uk wrote:
 
 
  Crontab is the daemon which runs cron jobs, and some distros have set up
  special files called cron.daily (or daily.cron I don't recall),
  cron.hourly, etc to make it easier to schedule jobs.
 
Quick clarification and correction here:
 
The cron *daemon* is crond, while the *script* that is
  batch-processed by cron is called the crontab.  When it is executed,
  it is referred to as a cron job.
 
That said, Ash is right about the rest.  Different OS flavors
  (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
  different path and file standards.  Linux, in general, uses a command
  `crontab` which opens the local user's environment-configured editor
  to modify the user's crontab in the spool.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  script runs
  ntp updates server time
  script runs again?
 
  But why now?  This process has been running just fine for months.
 
 
 
  Have you tried removing the job entirely from cron and re-adding it? It
  might be enough to kick-start the process into behaving.
 
 Yes my host asked me to do that earlier.  And nope - no better.
 
 I have told them it's gotta be something on their end because I tested 
 the script from a browser displaying what it was doing and it ran fine. 
   Removed my debug settings and ran it from a browser and again it ran 
 fine.  Re-scheduled the cron task and it ran wrong.
 


It does sound like it's definitely a problem their end. Could you alter
the script in some way to check for a token set on the correct schedule?
Or, perhaps rename the script and set up the cron to it again, so that
if there is a secondary link to it in cron it will fail, and might give
you an idea about where it's being called from.

I know this is all a crazy attempt to prove it's a problem with the
hosting, but from experience they can sometimes be slow to recognise it
without a lot of definite proof.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] cron job problem.

2002-01-10 Thread Mehmet Kamil ERISEN

Hello All,
I have a php script that i tested first through my browser.
If has a simple mail() command.
It workd fine and I received the email.
not I tried to run it as a cron job by adding 
#!/usr/local/bin/php -q
My webmaster account receives the confirmation that cron
job has run, but I do not receive the emails that the
program is 
supposed to send.
This is the code:
Thanks for the help...

#!/usr/local/bin/php -q
?php
$subject=Cron Job has run;
$body=test.php is running now;
$sendtome = [EMAIL PROTECTED];
mail($sendtome, $subject, $body);
?
--- mike cullerton [EMAIL PROTECTED] wrote:
 #!/usr/local/bin/php -q
 
 on 1/10/02 12:16 PM, Mark at [EMAIL PROTECTED]
 wrote:
 
  I've got this problem that won't go away.
  
  The headers are showing up at the top of the page when
 I run php in
  cgi mode. any ideas?
 
 
  -- mike cullerton 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




SV: [PHP] cron job problem.

2002-01-10 Thread Daniel Alsen

Hmm...don?t you have to actually create a job in crontab?

Saying that you want a mail every day at 6:00 you would want to create
something like:

* 6 * * * php /usr/local/bin/php  /dev/null

in crontab and lose #!/usr/local/bin/php -q in your script.

# Daniel Alsen| www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   | +46 8 694 82 22  #
# PGP: http://www.mindbash.com/pgp/  #


 Hello All,
 I have a php script that i tested first through my browser.
 If has a simple mail() command.
 It workd fine and I received the email.
 not I tried to run it as a cron job by adding
 #!/usr/local/bin/php -q
 My webmaster account receives the confirmation that cron
 job has run, but I do not receive the emails that the
 program is
 supposed to send.
 This is the code:
 Thanks for the help...

 #!/usr/local/bin/php -q
 ?php
 $subject=Cron Job has run;
 $body=test.php is running now;
 $sendtome = [EMAIL PROTECTED];
 mail($sendtome, $subject, $body);
 ?
 --- mike cullerton [EMAIL PROTECTED] wrote:
  #!/usr/local/bin/php -q
 
  on 1/10/02 12:16 PM, Mark at [EMAIL PROTECTED]
  wrote:
 
   I've got this problem that won't go away.
  
   The headers are showing up at the top of the page when
  I run php in
   cgi mode. any ideas?
 
 
   -- mike cullerton
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 


 =
 Mehmet Erisen
 http://www.erisen.com

 __
 Do You Yahoo!?
 Send FREE video emails in Yahoo! Mail!
 http://promo.yahoo.com/videomail/

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: SV: [PHP] cron job problem.

2002-01-10 Thread Mehmet Kamil ERISEN

Hi,
thanks for the reply.  I did setup the crontab already to
run every minute.
the webmaster account receives the report.
Here is the output that I get when I remove the
#!/usr/local/bin/php -q


/home/webvoire/www/cm/test.php: ?php: No such file or
directory
/home/webvoire/www/cm/test.php: =Cron Job has run: command
not found
/home/webvoire/www/cm/test.php: =test.php is running now:
command not found
/home/webvoire/www/cm/test.php: =: command not found
/home/webvoire/www/cm/test.php: syntax error near
unexpected token `mail($sendtome,'
/home/webvoire/www/cm/test.php:
/home/webvoire/www/cm/test.php: line 6: `   
mail($sendtome, $subject, $body);'
--- Daniel_Alsen [EMAIL PROTECTED] wrote:
 Hmm...don?t you have to actually create a job in crontab?
 
 Saying that you want a mail every day at 6:00 you would
 want to create
 something like:
 
 * 6 * * * php /usr/local/bin/php  /dev/null
 
 in crontab and lose #!/usr/local/bin/php -q in your
 script.
 
 # Daniel Alsen| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   | +46 8 694 82 22  #
 # PGP: http://www.mindbash.com/pgp/  #
 
 
  Hello All,
  I have a php script that i tested first through my
 browser.
  If has a simple mail() command.
  It workd fine and I received the email.
  not I tried to run it as a cron job by adding
  #!/usr/local/bin/php -q
  My webmaster account receives the confirmation that
 cron
  job has run, but I do not receive the emails that the
  program is
  supposed to send.
  This is the code:
  Thanks for the help...
 
  #!/usr/local/bin/php -q
  ?php
  $subject=Cron Job has run;
  $body=test.php is running now;
  $sendtome = [EMAIL PROTECTED];
  mail($sendtome, $subject, $body);
  ?
  --- mike cullerton [EMAIL PROTECTED] wrote:
   #!/usr/local/bin/php -q
  
   on 1/10/02 12:16 PM, Mark at [EMAIL PROTECTED]
   wrote:
  
I've got this problem that won't go away.
   
The headers are showing up at the top of the page
 when
   I run php in
cgi mode. any ideas?
  
  
-- mike cullerton
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail:
   [EMAIL PROTECTED]
   For additional commands, e-mail:
   [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
   [EMAIL PROTECTED]
  
 
 
  =
  Mehmet Erisen
  http://www.erisen.com
 
  __
  Do You Yahoo!?
  Send FREE video emails in Yahoo! Mail!
  http://promo.yahoo.com/videomail/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]