[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Automatic ASP execution across many virtual sites.



"Alex Lee" <alex@xxxxxxxxxx> wrote:
> You probably have a list of databases in which to propagate the
information.
> And you have the same set of information to go out to each db.
>
> Schedule a script that will parse the information for each db you wish to
> update, have it run daily. All you need to do then is update the list of
> db's when necessary.
>
> Assuming you want to schedule the script on the RaQ, one easy to do this
is
> in Perl and stick it in a cronjob.

Or from PHP using a CGI install of PHP...but the original poster was
emphatic that ASP is going to be used.  I question the need for a
programming language to accomplish the desired effect.  I don't recall
seeing the name of the DB being used, but if it's MySQL, a text file can be
created which lists the SQL statements and a cron job can be created to
schedule execution of the SQL statements.  Something like this.

[Contents of text file]
SQL statement 1;
SQL statement 2;
...
SQL statement n;

[CRON entry]
45 02 * * * . mysql -u root -pPASSWORD < /path_to/text_file > /dev/null 2>&1

And for better flexibility, if the SQL statements only differ in a field
value in a WHERE clause and the name of the DB it would be trivial to
modularize the text file into a bash function that is looped through based
on the DB and value from a separate text file...even for a MSCD.  ;-)  This
would make adding a new DB as simple as adding a line to a text file.
Without knowing anything about the SQL statements involved I can't guarantee
it will work in the poster's case, but it will work for many people with a
similar problem who are using a DB that can be run from the commandline like
MySQL or PostgreSQL.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/