Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 15th, 2005, 03:44 PM
LLX LLX is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,121 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 44 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
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.

Reply With Quote
  #2  
Old April 15th, 2005, 09:25 PM
Yian Yian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 279 Yian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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.

Reply With Quote
  #3  
Old April 15th, 2005, 09:37 PM
LLX LLX is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,121 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 44 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
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.

Reply With Quote
  #4  
Old April 16th, 2005, 03:11 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
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

Reply With Quote
  #5  
Old April 19th, 2005, 06:51 PM
Yian Yian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 279 Yian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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.

Reply With Quote
  #6  
Old April 19th, 2005, 07:01 PM
LLX LLX is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,121 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 44 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
RE: Discussion: Timed Jobs with no Cron

well yess cron is the prefered but sometimes its not available so...any other thoughts on alternatives?

Reply With Quote
  #7  
Old April 19th, 2005, 09:06 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
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

Reply With Quote
  #8  
Old April 20th, 2005, 08:22 PM
Yian Yian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 279 Yian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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.

Reply With Quote
  #9  
Old May 12th, 2005, 05:49 PM
LLX LLX is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,121 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 44 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
RE: Discussion: Timed Jobs with no Cron

no new thoughts people?

Reply With Quote
  #10  
Old May 12th, 2005, 11:34 PM
lig's Avatar
lig lig is offline
"Forum Nazi"
Click here for more information.
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,727 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 1 h 4 m 45 sec
Reputation Power: 6
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.

Reply With Quote
  #11  
Old May 21st, 2005, 04:37 PM
Yian Yian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 279 Yian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Discussion: Timed Jobs with no Cron

Probably both

No sorry, I haven't thought of anything new to add to the discussion.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Discussion: Timed Jobs with no Cron


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway