|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Discussion: Timed Jobs with no Cron
Just thought it might be fun to open a discusion on how to do "Cron jobs" without the actuall cron tabs, say your site doesnt support cron or your not experence in it. How would you do a cron with PHP, asp, java, or whatever.
We found a inovative way for Celebrity-institute, whever a admin logs in it trigers a scrip to check the DB if a student class expired then make the relevent updates. |
|
#2
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
Well, a simple way would be just to have a page that checks something, if true does the job, but if not just reloads the page in, say, 10 seconds. But this does require some user to be continuously have a browser window open and on that page so is kinda inefficient.
|
|
#3
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
thus this duscussions, Cron jobs are the prefered way but its good Progamiing Theory to look at alternatives.
|
|
#4
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
AH yes, I've done this before.
I had the code in a header file, that was included on every page. There was a file that had a timestamp of the last time this script ran, it checked it, if it had been more than 24 hours, then it ran a piece of code, updated the timestamp. If nobody was on the site, it didn't matter if the stuff remained undone, but the first person to visit after that 24 hour period triggered the update |
|
#5
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
Problem with that is that it cannot be used to do regular updates like one at 12:00 every day. I think Crons are probably the best way to do this kind of automated regular update/check. But for something like a shoutbox or other realtime chat system, Pickleman's method is good.
|
|
#6
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
well yess cron is the prefered but sometimes its not available so...any other thoughts on alternatives?
|
|
#7
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
Though I wonder what kind of task you would need to execute at exactly the same time, every day? What kind of operation would need to be done at the same time, constantly? Generally, if its just maintenence stuff, you can set something like that up. You could also do something like make a page, then use the windows task scheduler or something to open that webpage at a certain time every night
|
|
#8
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
That does require a computer to be on continuously and connected. The regular update thing: I once helped develop an online game in PHP which had the classical reset thing, so it was necessary to have a regular check.
|
|
#9
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
no new thoughts people?
|
|
#10
|
||||
|
||||
|
RE: Discussion: Timed Jobs with no Cron
haven't we talked about this a couple of times in the past months? Or am I in the twilight zone again.
|
|
#11
|
|||
|
|||
|
RE: Discussion: Timed Jobs with no Cron
Probably both
No sorry, I haven't thought of anything new to add to the discussion. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Discussion: Timed Jobs with no Cron |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|