Hi skate, thanks for you informative answer.
You asked for other solutions. Well one is already suggested, and that is to use the scheduler. It might also be possible to use at.exe, also (but this requires some programming knowledge) is to write once own service in C/C++, this is fairly straight forward if one know C/C++ and has the advantage that the process can be adjusted by the user in a fairly simple manner. Another possibility would is to install cygwin (Freeware - gnu - at http://www.cygwin.com/) and then one gets the power of *nix on the machine, and can for example schedule it with cron. Just look what happen at my NT prompt when I writes "man cron": [d:\]man cron CRON(8) CRON(8) NAME cron - daemon to execute scheduled commands (Vixie Cron) SYNOPSIS cron DESCRIPTION Cron should be started from /sbin/init.d/cron, /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. Cron searches /var/spool/cron/tabs for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab which is in a different format (see crontab(5)). Additionally, cron reads the files in /etc/cron.d; it treats the files in /etc/cron.d as extensions to the /etc/crontab file (they follow the special format of that file, i.e. they include the user field). The intended purpose of this feature is to allow packages that require finer control of their scheduling than the /etc/cron.{daily,weekly,monthly} directories allow to add a crontab file to /etc/cron.d. Such files should be named after the package that supplies them. Files must conform to the same naming convention as used by run-parts(8): they must consist solely of upper- and lower-case let- ters, digits, underscores, and hyphens. Like /etc/crontab, the files in the /etc/cron.d directory are monitored for changes. Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When executing com- mands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) command updates the modtime of the spool directory whenever it changes a crontab. SEE ALSO crontab(1), crontab(5) AUTHOR Paul Vixie <[EMAIL PROTECTED]> 4th Berkeley Distribution 20 December 1993 CRON(8) (END) > -----Original Message----- > From: skate [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 25, 2003 2:59 PM > To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED] > Subject: Re: [PHP-WIN] Re: php as exe in windows > > > php is a command line program, so yes, it has to be run in a command line > window, or through some kinda service (webserver). using VB you can hide the > command window, but that's not always an option, and with automated tasks > you can minimize it... but the command window is still there... > > the program would still be done in php, but php has to be called somehow, > and this would be easiest done through a command line window. a batch file > would be better suited to the whole thing, but this would still need to be > run from a command window. > > hence, why it is running php from the command line. > > i would shy away very much from running php permanently in a sleep loop, i'd > imagine the resource usage would be fairly big, and as said before, bad > programming could easily kill your computer... > > this is something easily achieved on *nix through crontabs, but windows > solution, the automated task, is a fair solution too. > > but i may be wrong, i'm sure there's a more fluid way of doing this??? > > skate - fatcuban.com > ----- Original Message ----- > From: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 25, 2003 1:52 PM > Subject: RE: [PHP-WIN] Re: php as exe in windows > > > > What about the added requirement: "I want to do this in php."? > > > > And I don't as obviously as you see the need this to run > > inside a window? Is this a kind of restriction on php, or? > > > > //Anders - very ignorant about php > > > > > -----Original Message----- > > > From: Mike Brum [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, March 25, 2003 2:21 PM > > > To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED] > > > Subject: RE: [PHP-WIN] Re: php as exe in windows > > > > > > > > > There's a few problems with that - Let's say someone closes the window > it's > > > running in - then it's gone. Or let's say there's an error and it haults > or > > > Windows just messes up (Windows - mess up? - never!). > > > > > > With the Scheduled Task option, you can add limits on how long it's > going to > > > run and other options. It's just a lot more stable. > > > > > > Not to mention that if you poorly write the PHP script - it will consume > A > > > LOT of memory! > > > > > > -Mike > > > > > > -----Original Message----- > > > From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, March 25, 2003 8:11 AM > > > To: [EMAIL PROTECTED] > > > Subject: RE: [PHP-WIN] Re: php as exe in windows > > > > > > > > > > > I want to create an application that I can run on my web-server > every five > > > > > minutes. The application should look in my ftp-catalogue and move > incomming > > > > > files to other directories. I want to do this in php. Is it > possible - and > > > > > in that case - how? > > > > > > Why not simply loop forever and execute your task and sleep for 5 > minutes > > > inside the loop fore each iteration? Can't be that hard to write such a > script. > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php