...

View Full Version : Looking for linux languages advice and scheduling program execution



jhilb
11-19-2003, 07:22 AM
Here is my situation... looking for advice on how to accomplish this....

I am running a web site using apache, php, and mysql on red hat linux. The site is very database intensive. About 50,000+ records are being added to a particular table every hour.

What I want to do is create a routine that will clean up this table, approximately every hour or so. First it needs to calculate some totals and place the results in another table. The process then can remove any records it will no longer need, which typically would be nearly the entire table.

I know I could create a routine on an already existing web page to check to see if an hour has past, and if so, start this clean-up process. But I cannot afford that constant checking for an hour to pass within an existing web page.

How can I create a recurring process in Linux? Something that fires every hour. Is their a process-scheduler of sorts that can accomplish this? Something of the equivalent of the windows application scheduler?

Let’s say this executes on the local database server… What is the best language to use to interface with MySql if executing locally? Perl, Python, something else?

On another note, what is a good linux language to use to retrieve a web page, parse it, and put some info into MySql with? Something that can do all three of those natively, that is, there are functions built into the language for grabbing a web page document, parsing it, and communicating with MySql. I know PhP has functions to do this, but I need something as a local executable.

A1ien51
11-19-2003, 02:20 PM
I know with SQL database you can have a predetermined package run at anytime you want. Part of my job at work is to monitor these packages every morning I come to work. I am sure that you can do the same thing with mySQL, but I never used that.

A1ien51
11-19-2003, 02:24 PM
To follow up on what I said, look at this:

http://www.asp101.com/articles/carvin/dts/default.asp

Eric

jhilb
11-19-2003, 11:57 PM
thanks, i'll check that out

DrWeb
12-17-2003, 01:32 AM
write a php script that does the procedure you want then in your console window type man crontab

bcarl314
12-28-2003, 03:57 AM
Originally posted by jhilb
On another note, what is a good linux language to use to retrieve a web page, parse it, and put some info into MySql with? Something that can do all three of those natively, that is, there are functions built into the language for grabbing a web page document, parsing it, and communicating with MySql. I know PhP has functions to do this, but I need something as a local executable.

First, PHP can be run as an executable. The only thing you need to do is add a #! line telling the computer where the interpreter is.

Second, PERL is a great alternative. I think it has native mySQL now. But if your looking a grepping files or text, that's what PERL was designed for.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum