Page 1 of 1

Running a PHP script with nice

Posted: Wed Nov 15, 2006 11:43 am
by kevin7654
Hello,

I'm trying to run a php script in the background on my webserver using nice. The reason behind this is that the script takes 30+ minutes to run (it deals heavily with photos) and I don't want it to slow the webserver down while its running. Does anyone know how to do this? I currently run the script through cronjob using "nice wget http://www.myphpscript.com".

Any suggestions?

Thanks,
Kevin

Posted: Wed Nov 15, 2006 1:51 pm
by timvw
Doesn't nice expect an -n option??? (man nice for more information).

Posted: Wed Nov 15, 2006 2:06 pm
by feyd
If you have alternate access to the domain, like FTP, I'd use that. If it isn't your domain, I hope you have permission to take the information ..and pictures.

Posted: Wed Nov 15, 2006 3:59 pm
by kevin7654
Yes I didn't copy the exact nice argument, I do provide it with the value 10, but it makes the wget call at priority 10 but then the httpd service responds and starts a process with priority 0

the pictures are already on my webserver and I do have permission for all of them.

thanks for the help

Posted: Wed Nov 15, 2006 4:06 pm
by feyd
If the files are already on your server, why copy them via a full remote request?

Posted: Wed Nov 15, 2006 4:37 pm
by kevin7654
Sorry I guess I didn't do a good job of explaining myself. All of the files are on my server, there is no remote request. It is just manipulating the pictures.