This is a discussion on question within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Not sure if PHP is right for this... but maybe you guys can point me the right way. I want ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Mar 19, 12:45 am, "Alan Larsson" <newsgr...@alstown.com> wrote:
> Not sure if PHP is right for this... but maybe you guys can point me the > right way. > > I want a website that with the click of a button by someone accross the web > can run a predefined scheduled task on the web server. You hopefully talk about Linux. Here is how I would do it: Set up cron (using crontab -e) so that it executes a script that checks periodically for a file (for example; I think this is easier). This file is created by a Php or Perl script run in the web server. If the file exists the script triggered by cron executes the predefined scheduled task. Hope it helps. Cheers Jurij |
|
|||
|
Alan Larsson schrieb:
> Not sure if PHP is right for this... but maybe you guys can point me the > right way. > > I want a website that with the click of a button by someone accross the web > can run a predefined scheduled task on the web server. > > Any ideas? > > What is this predefined task? Is there a shell script or program you can already run from the command line, but want to trigger through a web page request as well? If Apache and your PHP settings have the sufficient permission needed to execute system commands, then that will work - the relevant function is system() - as in system("ls -l"). If you want to code the entire scheduled task in PHP, it will depend more on what it actually deals with - files, database changes, etc... -- Christoph Burschka |