Koozali.org: home of the SME Server
Contribs.org Forums => General Discussion => Topic started by: weblance on March 24, 2011, 01:49:24 PM
-
Is ti possible to create a cronjob on the SME that executes an external PHP script once every hour? If yes, how?
/Carl
-
please, define "external"
php has a cli too
-
please, define "external"
php has a cli too
External: http://www.remotedomain.com/script.php
-
a script that use wget or curl in cron.d or crontab should do what you need..
do you expect to send parameters? do you need to get any result?
-
Sorry for the late reply.
I do not need to send any parameter and i don't get a result. I only need to run a script on a remote server. Is there a timeout? What I mean is that the remote script can take several minutes to excute.
-
Sorry for the late reply.
I do not need to send any parameter and i don't get a result. I only need to run a script on a remote server. Is there a timeout? What I mean is that the remote script can take several minutes to excute.
wget is your friend :-)
man wget for more details
-
Thank you very much!
I'll check wget out. What about execution time, is there a limit? The script can take several minutes to complete...
-
I'll check wget out. What about execution time, is there a limit? The script can take several minutes to complete...
read the man page, you'll find the answer
-
The script can take several minutes to complete...
Most web browsers and most web servers won't allow it to complete if it takes that long.
-
the problem with timeout can be avoid on the webserver side using the comand set time limit in the loop (i guess there is some loop in it ;)
each time it will set the timeout it will be reseted to 0 ... set a timeout value for one pass in the loop ( 10 seconds per pass should be enough)
http://php.net/manual/en/function.set-time-limit.php
usually the timeout is 30 second to complete all the script