Cron functionality under Windows XP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leigh Riley

    Cron functionality under Windows XP

    Hi there,

    Can anyone tell if there's a solution to this for a Windows environment?
    If this was running under Linux, it would be a problem, but...

    I have a php script that when run, examines a file, and then updates a
    local database. I would like to run this script (in the background - not
    in a browser window) via the command line every e.g. 100 seconds - any
    ideas?

    Thanks in advance!

    - Lee

  • Ian.H [dS]

    #2
    Re: Cron functionality under Windows XP

    On Tue, 26 Aug 2003 13:54:45 -0600 in
    <message-id:3f4bbaf7$1_3 @news3.es.net>
    Leigh Riley <dontEmailMeDir ectly@home.org> wrote:
    [color=blue]
    > Hi there,
    >
    > Can anyone tell if there's a solution to this for a Windows
    > environment? If this was running under Linux, it would be a problem,
    > but...
    >
    > I have a php script that when run, examines a file, and then updates a
    >
    > local database. I would like to run this script (in the background -
    > not in a browser window) via the command line every e.g. 100 seconds -
    > any ideas?
    >
    > Thanks in advance!
    >
    > - Lee
    >[/color]


    Lee,

    I've never run PHP cmdline (especially on windoze) but...


    windoze scheduler (in control panel) is equiv. of /etc/crontab
    Not sure how you'd get this to run in the background though.. Perl for
    windoze comes with wperl.exe to run things in the background.. not sure
    about PHP though.. and no windoze box available for me to check on.


    HT(possibly?)H =)



    Regards,

    Ian

    --
    Ian.H [Design & Development]
    digiServ Network - Web solutions
    www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
    Programming, Web design, development & hosting.

    Comment

    • Leigh Riley

      #3
      Re: Cron functionality under Windows XP

      Hi, thanks for your reply. Windows Scheduler will let me schedule stuff,
      but not more often that once per day.

      Ian.H [dS] wrote:
      [color=blue]
      > On Tue, 26 Aug 2003 13:54:45 -0600 in
      > <message-id:3f4bbaf7$1_3 @news3.es.net>
      > Leigh Riley <dontEmailMeDir ectly@home.org> wrote:
      >
      >[color=green]
      >>Hi there,
      >>
      >>Can anyone tell if there's a solution to this for a Windows
      >>environment ? If this was running under Linux, it would be a problem,
      >>but...
      >>
      >>I have a php script that when run, examines a file, and then updates a
      >>
      >>local database. I would like to run this script (in the background -
      >>not in a browser window) via the command line every e.g. 100 seconds -
      >>any ideas?
      >>
      >>Thanks in advance!
      >>
      >> - Lee
      >>[/color]
      >
      >
      >
      > Lee,
      >
      > I've never run PHP cmdline (especially on windoze) but...
      >
      >
      > windoze scheduler (in control panel) is equiv. of /etc/crontab
      > Not sure how you'd get this to run in the background though.. Perl for
      > windoze comes with wperl.exe to run things in the background.. not sure
      > about PHP though.. and no windoze box available for me to check on.
      >
      >
      > HT(possibly?)H =)
      >
      >
      >
      > Regards,
      >
      > Ian
      >[/color]

      Comment

      • Tom Thackrey

        #4
        Re: Cron functionality under Windows XP


        On 26-Aug-2003, Leigh Riley <dontEmailMeDir ectly@home.org> wrote:
        [color=blue]
        > Hi, thanks for your reply. Windows Scheduler will let me schedule stuff,
        > but not more often that once per day.[/color]

        if you click the 'advanced' button on the schedule tab you can schedule as
        often as every minute.

        --
        Tom Thackrey

        Comment

        • Nikolai Chuvakhin

          #5
          Re: Cron functionality under Windows XP

          Leigh Riley <dontEmailMeDir ectly@home.org> wrote
          in message news:<3f4bbaf7$ 1_3@news3.es.ne t>...[color=blue]
          >
          > Can anyone tell if there's a solution to this for a Windows environment?
          > If this was running under Linux, it would be a problem, but...
          >
          > I have a php script that when run, examines a file, and then updates a
          > local database. I would like to run this script (in the background - not
          > in a browser window) via the command line every e.g. 100 seconds - any
          > ideas?[/color]

          A good old endlessly looping *.bat file will probably work...
          Let's say you have these four lines in a file called script.bat:

          :START
          start php.exe your_PHP_script .php
          choice /ty,100 > nul
          goto START

          This batch file would call your PHP script from the command line
          (the script will be executed in the background), wait 100 seconds
          (note that since you called 'start php.exe' rather than just
          'php.exe', the delay will not include the script's execution time),
          and do everything all over again.

          All you have to do to endlessly run it in the background is to type:

          start script.bat

          in the command prompt.

          Cheers,
          NC

          Comment

          Working...