Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Nov 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looking for linux languages advice and scheduling program execution

    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.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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.
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    To follow up on what I said, look at this:

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

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    New Coder
    Join Date
    Nov 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks, i'll check that out

  • #5
    New Coder
    Join Date
    Nov 2003
    Location
    S.F.
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    write a php script that does the procedure you want then in your console window type man crontab
    there are no stupid questions, but there are stupid answers

  • #6
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts

    Re: Looking for linux languages advice and scheduling program execution

    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •