View Full Version : Problem, please help.
AnkisethGallant
05-25-2002, 09:10 PM
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?
sifuhall
05-25-2002, 09:11 PM
If you're on a Unix box, crontab is a good option
Steve Machol
05-25-2002, 09:23 PM
As sifuhall said, use 'crontab' for Unix/Liniux servers or Widnows Scheduler for Windows servers.
AnkisethGallant
05-25-2002, 09:48 PM
Sounds good, but you'll probably need to be more specific than that, I don't know what either of those are.
AnkisethGallant
05-25-2002, 09:54 PM
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?
sifuhall
05-25-2002, 10:00 PM
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
Steve Machol
05-25-2002, 10:02 PM
http://www.superscripts.com/tutorial/crontab.html
http://www.usats.com/learn/crontab.shtml
http://www.aota.net/Script_Installation_Tips/cronhelp.php4
AnkisethGallant
05-25-2002, 10:08 PM
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.
sifuhall
05-25-2002, 10:15 PM
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.
AnkisethGallant
05-25-2002, 10:22 PM
alright, I'll do that.
Thanks a lot for the help.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.