0

What i try to do >

1.User visit my PHP base Page

2.My page collect its data

3.Add cron job using PHP (Q1.How to add Cron job using PHP? ) (this type of cron job command currently i am using ""/usr/bin/wget myweb.org/some_directory/file.php?uid=2738 >/dev/null""

4.Cron job runs a above URL and do a task with user id which takes almost 1 hour + time (Q2. Is it possible to run job at the same time or after one minute if possible how)

5.If another user visit the page on the same time above procedure is also happen for them too (Q3.So this is possible)

hakre
  • 193,403
  • 52
  • 435
  • 836
Abdullah Adam
  • 178
  • 5
  • 19
  • It is difficult to tell what is being asked here. Could you please clarify? – Tyler Crompton May 27 '12 at 19:56
  • **Note:** I hear that some other things are available too like Deamon etc but the problem is that i didn't known how that works and if i start learn about that than it consumes more time so is there any solution for that ? You see above 3 question maybe is looks that its not according to terms but actually the second and third question is for further clearance **thanks** – Abdullah Adam May 28 '12 at 07:13
  • Please ask only one question at once. What is visible as well is that your questions on it's own have already been answered. So obviously there is great room of improvement. You should consider being more helpful here. – hakre May 28 '12 at 10:56

1 Answers1

0

Sounds to me that what you need is not a cron job but a background worker process. Cron jobs are jobs that are run at a specific automated time (such as 2:30 PM every day), not every time a user visits your page which could be whenever.

In order to instantiate background worker processes, I strongly recommend using Pheanstalk. Check out the readme to see how to instantiate a worker process, it's pretty easy.

jstrong
  • 1,631
  • 13
  • 15