SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Cron jobs
-
May 3, 2002, 14:23 #1
- Join Date
- Aug 2000
- Location
- Thailand
- Posts
- 4,810
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Cron jobs
I always get our hosting team (managed server) to set these up, but hate not being able to do things!
I currently run a little bit of php on www.meetinthemiddle.co.uk that changes the "featured venue" each time the index.php page is loaded. It just picks a random record from the db. I'd like to actually make this change daily - and obviously a cron job is in order - but I haven't the foggiest how to do it myself.
I could get the team to do it, but would really like to expand my skills base and learn how to do it.
At the mo, I'm guessing that I could make the server load a php page that changes the record daily - am I thinking along the right lines? And if so, can anyone offer a little guidance?
Cheers,
H~The Artist Latterly Known as Crazy Hamster~
922ee590a26bd62eb9b33cf2877a00df
Currently delving into Django, GIT & CentOS
-
May 4, 2002, 15:17 #2
- Join Date
- Jul 2001
- Location
- Earth ... maybe
- Posts
- 401
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How about this:
Instead of generating a random number (whose random seed is initialized based on time of day in seconds...), you initialize the random seed generator with the current date. Then generate random number (or even just hash the current date in some manner to get a number).
This would eliminate the need for any cron jobs/daily scripts,etc.etc.
-
May 8, 2002, 22:55 #3
- Join Date
- Aug 2001
- Location
- Kent, Ohio
- Posts
- 367
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Re: Cron jobs
Originally posted by TheOriginalH
At the mo, I'm guessing that I could make the server load a php page that changes the record daily - am I thinking along the right lines? And if so, can anyone offer a little guidance?
Here's a tutorial on creating cgi's with php:
http://www.tldp.org/HOWTO/PHP-HOWTO-18.html
And here's a tutorial on setting up cronjobs:
http://www.superscripts.com/tutorial/crontab.html
-
May 10, 2002, 13:30 #4
- Join Date
- Aug 2000
- Location
- Thailand
- Posts
- 4,810
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I believe that is the holy grail I've been looking for, thanks very much
I'm a little confused about the whole php/cgi thing, but then I always have been and need to understand it better...~The Artist Latterly Known as Crazy Hamster~
922ee590a26bd62eb9b33cf2877a00df
Currently delving into Django, GIT & CentOS
-
Jun 5, 2002, 17:28 #5
- Join Date
- Jun 2002
- Location
- Italy
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
fetch -o - http://www.yoursite.com/yourscript.php
should work
-
Jun 6, 2002, 12:36 #6
Or use fetch or lynx and access the page actomatically online using a password protected page. It's easy and works well
Owen
Bookmarks