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

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



Many thanks Alex and Bob, we at least have a starting point for
experimentation!

Regards

Si Watts



>We need to be able to automatically "push" data from the central db into
>each client db at a predefined time each day, based upon data changes made
>within the central db, in the form of an automatic update. This would
>obviously need there to be an ASP script called and executed on the main db
>site at a predefined time each and every day, ie on a schedule.
>
>Any help would be greatly appreciated.
>TIA
>
>Regards
>
>Si Watts
>SiWIS
>http://www.siwis.com

I know what you're going through.  I'm new to all this linux & perl stuff
myself.  Since I do know ASP, I built an ASP page for my functionaility
(queries a MySQL db each night and performs certain operations based upon
the result of the query).

This is how I accomplished the task:

1-Made my ASP page
2-Placed this page, we'll call it "mypage.asp", into a password protected
directory within the website
3-Logged into my server via SSH
4-Logged in as root (su)
5-Changed to the /etc directory
6-Created a file that will run my asp page each day, lets call it
"schedule".  This file contained only 1 line as follows:
 15 1 * * * wget -q --spider --http-user username_here --http-passwd
pass_here http://www.yourdomain.com/path/mypage.asp > /dev/null 2>&1
7-executed the following:
 crontab -e schedule

Line 6 specifies the parameters for your scheduling.  As typed above, it has
the following meanings:
 "15 1 * * *" is in the form of minute, hour, day, month, day of week
 "wget" a utility to retreive files via http
 "-q" quiet mode, no output
 "--spider" I read in the archives that this basically does the same thing
as "-q" and should be included.  Not sure why, but it works for my app.
"-http-user username_here " when prompted for a username to get into the
password protected directory, the wget utility will respond with
"username_here"
"-http-passwd pass_here" when prompted for a password to get into the
password protected directory, the wget utility will respond with "pass_here"
The http:... should be obvious
"> /dev/null 2>&1" ensures any output returned from your script is deleted

Line 7 takes your file (schedule) and enters it into the cron utility so it
will be executed based on the frequency you specified.

You don't have to place your asp page into a password protected directory, I
did because I don't want anyone accidentaly executing mine.  Some of my
explanations may not be the greatest, and there may be an easier way of
doing this, but when you lack experience you have to do what you can.

bob c.

_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users

-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Alex Lee
Sent: 02 May 2001 19:33
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: RE: [cobalt-users] Automatic ASP execution across many virtual
sites.


> The data structure is exactly the same within all db's, the only
> difference
> being that the stored data in each client db reflects only their own
> requirements, but the central db carries ALL records. We have initially
> chosen to push, rather than pull, because it means only executing
> one script

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.

You can't execute ASP pages outside of the context of the web server (well
you could using wget but it's not exactly ideal)


alex

_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users