Results 1 to 3 of 3

Thread: Running a script every so often but not triggered by the user?

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Question Running a script every so often but not triggered by the user?

    How would you go about running a script every 4 minutes say....I'm wanting my app to send a email out and if its not been dealt with within 10minutes (approx) I want another email to be sent, this should repeat untill it has been dealt with.So is there a way to have a script keep running? I suppose I could do this by having it make a page which uses Javascript to refresh the page every 4 minuts but I'd prefer it if I could do it without a computer needing to have a page open like that.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Running a script every so often but not triggered by the user?

    I know how to do this on Linux but not sure about Windows. In Linux a process called cron is responsible for schedualing jobs, you will need shell access from your web host then at the command prompt type:
    Code:
      # crontab - e
    In the editor window to run a script ever 4 minutes enter the following and save the file (it should say crontab installed after saving):
    */4 * * * * /path/to/php/script.php

    Have a look here for a full explanation of the syntax of this file.

    Make sure you enter the following line at the top of the script:

    #!/path/to/php/cgi
    Last edited by visualAd; Jul 6th, 2005 at 04:53 PM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Re: Running a script every so often but not triggered by the user?

    Quote Originally Posted by visualAd
    I know how to do this on Linux but not sure about Windows. In Linux a process called cron is responsible for schedualing jobs, you will need shell access from your web host then at the command prompt type:
    Code:
      # crontab - e
    In the editor window to run a script ever 4 minutes enter the following and save the file (it should say crontab installed after saving):
    */4 * * * * /path/to/php/script.php

    Have a look here for a full explanation of the syntax of this file.

    Make sure you enter the following line at the top of the script:

    #!/path/to/php/cgi -f
    Thanx, yea my server lets me run CronTabs, has a little control panel for it but I guess I'll be able to figure out how it works .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions

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



Click Here to Expand Forum to Full Width