1

Possible Duplicate:
PHP: running scheduled jobs (cron jobs)
How to run a PHP file in a scheduled task (Windows Task Scheduler)

i want execute php code in 1:00 clock in every day . Scorsese i know php running when web page viewed . for example i want update field of my database in Specified time (e.g 1:00 clock).
there is way or not ?
thanks .

Community
  • 1
  • 1
aya
  • 1,577
  • 4
  • 29
  • 59

1 Answers1

0

may be you could try with things like this one :

http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/

Is for do one daemon with php and later configure it as you want. Other possibility is crontab and with it execute one file each 1m,2m,...( execute contrab -e for edit it and crontab -l for see it ) :

*/1  * * * * /usr/bin/php /Users/rfanjul/Public/inversia/app/console twitter:hashtags:get

the last option is create one bash file like this one:

tiempo="10s"
comando="sensors"
fich_salida="temperatura.txt"
while [ true ]; do
sleep $tiempo
echo ///////////////////////// >> $fich_salida
echo ///////////////////////// >> $fich_salida
date >> $fich_salida  
echo ///////////////////////// >> $fich_salida
$comando >> $fich_salida
echo ///////////////////////// >> $fich_salida
done

For you i think that the better solution is crontab with this configuration:

* 1 * * * file
Rubén Fanjul Estrada
  • 1,246
  • 16
  • 31