OT (possibly): Scheduled actions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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.



Re: OT (possibly): Scheduled actions

Quoted text here. Click to load it

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...

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.

Re: OT (possibly): Scheduled actions

Quoted text here. Click to load it

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

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

Site Timeline