Hi Nicole
Some comments...

You're redirecting stdout - I would redirect stderr as well i.e. >/dev/null
2>/tmp/errlog.
Can't say about the load on the server - depends entirely on what your
background script does...  do you want to throttle the number of spawned
processes or are you happy to let 500 processes get kicked off at once? You
may hit a Linux fork limit with 500+ processes being started....
You may want to add a 'nohup' to the start to supress termination from a
hangup signal.

HTH
Rich

-----Original Message-----
From: Nicole Amashta [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2002 02:29
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Calling PHP script with Exec


Hello PHPWinGroup!


I am writing a php script that will need to call via exec() a 2nd php script
to run in the background. (OS: linux)

I am thinking it would look something like this:


exec("php script2.php $param > /dev/null &");

I haven't actually attempted this yet. Was just hoping for a confirmation
that I am on the right track. And what is the payload of doing something
like this, if say, oh, 500+ people are doing this at the same time? No
access to crons, so can't do that. This is my hack or workaround for not
having scheduling ability. So I just call a 2nd script to run in background
to handle the script that will take longer. Don't want people waiting for a
script to finish.

Some server specs:
OS: linux (on a hosted server i have no access to at all)
Crontab: nope

Thanks!!

--
Nicole
www.aeontrek.com
- - - -




--
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

Reply via email to