Reply to Re: php and cron

Your name:

Reply:


Posted by Alvaro G. Vicario on 09/07/06 23:40

*** giangiammy escribió/wrote (7 Sep 2006 05:32:49 -0700):
> I don't know if this is possible, but I need to accomplish an action
> at a given hour (what cron does): is it possible to do something like
> this having a web hosting service with php support?
>
> any other possibilities to do something like this without having
> access to cron facilities?

If the schedule is flexible enough and you just want to do it "once a day"
and the like... and taking for granted you do have a web site... A possible
approach is to launch the script from your site. Let me explain:

1) You put your code in a file

2) You choose a page on your site (or maybe an include file)

3) You get a random number and decided upon it whether the script will be
launched


// Not tested!
if(mt_rand(1, 1000)){
system('nohup /foo/var.php &');
}

You can make additional checks so it won't be executed in less than X
hours.


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация