PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > PHP kill cron
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP kill cron

Réponse
 
LinkBack Outils de la discussion
Vieux 27/10/2007, 12h16   #1
Séverin Richard
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP kill cron

Hi all,

How can i kill a cron process at the begining of my cron task (php script):


My cron task starts evry 5 minutes,
but may work more than this time. (no timeout configured on my server
for cron tasks (?).


I guess if i can stop every process of this task before starting it again.


my task looks like:
usr/local/bin/php -q -f /home/mypass/cron.php

then php script cron starts...


THX for ,idears.
  Réponse avec citation
Vieux 27/10/2007, 14h18   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP kill cron

Séverin Richard wrote:
> Hi all,
>
> How can i kill a cron process at the begining of my cron task (php script):


Easy way is to do a killall (see the man page how to use it), of course
this would kill the current process too.

A more advanced is to have a process list (file) where you store the
process number each time that a script is run, the script then kills all
the processes in the list except its own, clear out the processes it has
killed.


> My cron task starts evry 5 minutes,
> but may work more than this time. (no timeout configured on my server
> for cron tasks (?).


Time out is for web servers only, if you want to do a time out thing in
cli scripts, then you need to build it yourself into your scripts.



--

//Aho
  Réponse avec citation
Vieux 24/11/2007, 12h02   #3
Floor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP kill cron

Séverin Richard:

> How can i kill a cron process at the begining of my cron task (php
> script):


Why should you schedule crons tasks thru a php script rather than directly
in the crontab?
Floor


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h24.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,47792 seconds with 11 queries