I want to run a background scheduler in my web application. This scheduler will check the current time and if it matches with the programmed time then it sends a E-mail. How can i create background Scheduler ?
Asked
Active
Viewed 1.1k times
1
-
2It's called a cron job. You almost can find it at your server control panel. – Tariq Jan 27 '16 at 17:35
-
you're looking at it wrong. pretty much every modern OS already HAS a "background scheduler". You just need to hook into your specific operating system's version of it and tell it to schedule your php script. – Marc B Jan 27 '16 at 17:37
-
i want to add scheduler within my application. – Zala Krunal Jan 27 '16 at 17:42
-
i don't have any knowledge of cron job. – Zala Krunal Jan 27 '16 at 17:43
2 Answers
3
It depends if you want to run a script in background via command line, than you can use exec
command: exec
Or if you want to start another thread, than you can use pthreads
If you want to have a job that executes at a certain time or in certain intervals, you can set up a cronjob. This tutorial is very helpful, and if you are on linux you can look at this documentation.

bpoiss
- 13,673
- 3
- 35
- 49
-
yes i want to run a script in a background which will check the current time and if it matches with the time of script then it should send a mail to particular email id. – Zala Krunal Jan 27 '16 at 17:40
-
2
-