SunQuest
           Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

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 Dev Shed Forums Sponsor:
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  
Old August 19th, 2000, 11:34 AM
benliong benliong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 56 benliong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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?

Reply With Quote
  #2  
Old August 19th, 2000, 12:50 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
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"

Reply With Quote
  #3  
Old August 19th, 2000, 02:31 PM
benliong benliong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 56 benliong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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

Reply With Quote
  #4  
Old August 19th, 2000, 04:20 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
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.

Reply With Quote
  #5  
Old August 19th, 2000, 04:26 PM
benliong benliong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 56 benliong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Thanks so much. So the idea of having the program to update a mysql database should work from what I understand?

Thanks again.

--Ben.

Reply With Quote
  #6  
Old August 19th, 2000, 05:47 PM
benliong benliong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 56 benliong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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?

Reply With Quote
  #7  
Old August 20th, 2000, 02:29 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 9
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Information Retrival Script


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 1 hosted by Hostway