OT (possibly): Scheduled actions

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

    OT (possibly): Scheduled actions

    I've got a dedicated server running Windows 2003, IIS, MySQL and PHP.

    I'm working on a web site which needs to pick data up on a semi-regular
    basis from a CSV file which will exist in a directory accessible to this
    server. The data will be put there by another server.

    I need to pick up this data and insert it into a MySQL table; I have three
    options in theory - do it on a strict schedule, do it on request by an admin
    user (the easy option), or have it happen automatically if a file drops into
    that directory.

    Can PHP do this, or do I need to look at something else to do this for me? I
    can install/setup anything I like on this server, within reason.

    TIA.

    Pete.


  • Michael Vilain

    #2
    Re: OT (possibly): Scheduled actions

    In article <cvth7l$mut$1$8 30fa7a5@news.de mon.co.uk>,
    "PeteC" <newsgroupsdemo n@removethisbit acutecomputing. co.uk> wrote:
    [color=blue]
    > I've got a dedicated server running Windows 2003, IIS, MySQL and PHP.
    >
    > I'm working on a web site which needs to pick data up on a semi-regular
    > basis from a CSV file which will exist in a directory accessible to this
    > server. The data will be put there by another server.
    >
    > I need to pick up this data and insert it into a MySQL table; I have three
    > options in theory - do it on a strict schedule, do it on request by an admin
    > user (the easy option), or have it happen automatically if a file drops into
    > that directory.
    >
    > Can PHP do this, or do I need to look at something else to do this for me? I
    > can install/setup anything I like on this server, within reason.
    >
    > TIA.
    >
    > Pete.[/color]

    Generally, php is a server-side web formatting and programming language.
    It's meant to site between a browser and a web server. It _can_ be
    built as a command-line utility on UNIX but I don't know about W2003.
    You're better off doing this on Linux or using Perl.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    Comment

    • Chung Leong

      #3
      Re: OT (possibly): Scheduled actions


      "PeteC" <newsgroupsdemo n@removethisbit acutecomputing. co.uk> wrote in message
      news:cvth7l$mut $1$830fa7a5@new s.demon.co.uk.. .[color=blue]
      > I've got a dedicated server running Windows 2003, IIS, MySQL and PHP.
      >
      > I'm working on a web site which needs to pick data up on a semi-regular
      > basis from a CSV file which will exist in a directory accessible to this
      > server. The data will be put there by another server.
      >
      > I need to pick up this data and insert it into a MySQL table; I have three
      > options in theory - do it on a strict schedule, do it on request by an[/color]
      admin[color=blue]
      > user (the easy option), or have it happen automatically if a file drops[/color]
      into[color=blue]
      > that directory.
      >
      > Can PHP do this, or do I need to look at something else to do this for me?[/color]
      I[color=blue]
      > can install/setup anything I like on this server, within reason.[/color]

      The elegant solution would be to write a Windows service and have it monitor
      the folder containing the file and spawn an instance of PHP CLI when the
      file has changed. If you know C/C++ and Windows programming, it's not that
      hard. You might also be able to find an existing freeware app that does
      that.

      You could also use the Schedule Task feature that you will find the Control
      Panel to run PHP on a schedule.



      Comment

      • tintub@gmail.com

        #4
        Re: OT (possibly): Scheduled actions

        PHP can be run from Windows 2003 as a command-line utility. The idea
        that PHP is not very good as a shell scripting language is incorrect -
        PHP is a very useful and a very capable alternative to bash, perl etc.
        It's more portable than bash (although cygwin will allow you to run
        bash on windows), and easier to maintain than perl. Really, what it
        comes down to is what language you know best and which you can code
        quickly. If you are more comfortable using PHP, then I can't think of
        a single reason to use Perl for this.

        Comment

        Working...