Hello,
Sorry if this is a really dumb question, but I have a PHP script on my server. And using cron, I call this script throughout the day. I also have a second cron job setup to call a second script. The second script is setup to run three minutes after the first script. So it works like this...
cron1 calls http://domain.com/script1.php... then...
cron2 calls http://domain.com/script2.php...
Is it possible to put something inside script1.php that will call script2.php once script1.php is done processing? The reason I am wondering... is so that I only have to run 1 cron job instead of two.
Is this type of thing possible? Can one php script run... and then call another script just like a cron job?
Thanks for any help.
Kindly,
John
Can a PHP script call a webpage like cron?
Moderator: General Moderators
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
Try sleep() for the delay.
-
phpmyborder
- Forum Newbie
- Posts: 2
- Joined: Tue Dec 06, 2005 11:15 am
- Location: Norway
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You know what's interesting... I've never checked if the timeout waits while sleep() has been called... e.g. If you had a script with sleep(60) would it timeout or would it run for up to 90 seconds?phpmyborder wrote:beware... the default timelimit is 30 seconds, so your script may timeout if you dont use set_time_limit()...
/must go and test
- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
It will time out. The sleep time is included in the total execution time.d11wtq wrote:You know what's interesting... I've never checked if the timeout waits while sleep() has been called... e.g. If you had a script with sleep(60) would it timeout or would it run for up to 90 seconds?phpmyborder wrote:beware... the default timelimit is 30 seconds, so your script may timeout if you dont use set_time_limit()...
/must go and test