|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I'd written a script to get stock values from some site and put them onto a mySQL Database every minute or so. the script works fine except that I have to ssh to my server at phpwebhosting.com in order to have it running. is there a way to configure it such that it runs automatically everyday or so?
|
|
#2
|
|||
|
|||
|
Run a crontab. Make a file called crons.txt (or whatever you want it to be) and put this line in it:
1 * * * * perl /full/path/to/script.pl then at the command prompt type this: crontab crons.txt This will setup your crontab for the info in crons.txt. Now the system will "perl /full/path/to/script.pl" every minute" |
|
#3
|
|||
|
|||
|
Thanks so much.
Few more questions. How do I know if my service provider is running cron the daemon? and I tried it with a simple perl script to print something out but it doesn't do anything after long wait. what should I do? thanks again. --Ben |
|
#4
|
|||
|
|||
|
PHP Web Hosting allows you to run crons. (I know this from experience). The only way to check it is to have it e-mail you something, it wont print anything to the screen. Just setup a simple e-mail program and set it in the crontab.
P.S. You can type "crontab -l" at the command prompt to see your current crons. |
|
#5
|
|||
|
|||
|
Thanks so much. So the idea of having the program to update a mysql database should work from what I understand?
Thanks again. --Ben. |
|
#6
|
|||
|
|||
|
my script has not been working. Can you check with me if I have the crontab configuration correct?
my user name in phpwebhosting is moliu. * * * * * perl /home2/moliu/cgi-bin/test.pl should I use quotation or something like that? |
|
#7
|
|||
|
|||
|
I don't think that the server will let you put * * * * *. This would run every second.. that's not something the server wants you to do.
No, you don't need quotes. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Information Retrival Script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|