The Arcive of vBulletin Modifications Site. |
|
Problem, please help. Details »»
|
|||||||||||||||||||||||||
I'm making a script, and I want something to happen automatically after a certain time. How do I do this? For example, say I want a bank to calculate interest every 24 hours, regardless if the person visits the bank or not. Any ideas?
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
If you're on a Unix box, crontab is a good option
|
|
#3
|
||||
|
||||
|
As sifuhall said, use 'crontab' for Unix/Liniux servers or Widnows Scheduler for Windows servers.
|
|
#4
|
||||
|
||||
|
Sounds good, but you'll probably need to be more specific than that, I don't know what either of those are.
|
|
#5
|
||||
|
||||
|
I've looked at crontab, and it sounds easy enough. Does it automatically just run the file you point it to. So, if I made a interest.php file, would it automatically run that file every 24 hours?
|
|
#6
|
|||
|
|||
|
It's a little more detailed than that. You specify when the file is to run, then what file or command is to execute.
Here's an overview. http://hoth.stsci.edu/man/man1/crontab.html |
|
#7
|
||||
|
||||
|
http://www.superscripts.com/tutorial/crontab.html
http://www.usats.com/learn/crontab.shtml http://www.aota.net/Script_Installat.../cronhelp.php4 |
|
#8
|
||||
|
||||
|
So:
0 0 * * * /directory/interest.php That's what I would need in the crontab file? I think I've got it. Any ideas on how to connect to telnet? If you don't know, I'll just ask the guy in charge of the server. |
|
#9
|
|||
|
|||
|
My personal preference is to use lynx -dump to execute php scripts, but again that is my personal preference.
For example: 0 0 * * * lynx -dump http://www.yoursite.com/interest.php (the dump tag just helps a little to keep the responses to crontab down) As far as telneting to your server, yeah, I do suggest you contact the person in charge of the server. |
|
#10
|
||||
|
||||
|
alright, I'll do that.
Thanks a lot for the help. |
![]() |
|
|