jhilb
11-19-2003, 06: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.
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.