Just a bit off topic, but incrementing a counter requires just 1 statement: (and a directDBMS)
UPDATE counter SET hits=hits+1 WHERE page='<your page ident>'; Here the database does the incrementing, not Tango. obviously one hourly hit is less stressy than one for each page, but with this statement you will save 2 queries. -thijs > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Jon Grieve > Sent: Tuesday, April 30, 2002 9:04 AM > To: Multiple recipients of list witango-talk > Subject: RE: Witango-Talk: Cron Setup > > > > Going on from the different methods of doing scheduled/cron jobs, > I thought > I'd share a little tip with the list... > > Often, I need to hit a cron-type job that accesses Witango variables. In > order to have access to domain- and application-scope variables, the TAF > needs to be accessed using the appropriate URL. So, I have to > 'expose' the > TAF to the outside world so that I can get to it from a text-mode browser. > > The tip is to put the TAF files in a folder that is not > accessible from the > Web root, then - using IIS (and I'm sure Apache, etc can be configured the > same) - create a virtual root to that location. For that virtual folder, > you can then assign IP-based security so that it only allows access to > requests originating from, say, 127.0.0.1. > > An example of this exists on my homepage: http://jongrieve.net/ ... > > In the footer, there is a hit counter, which is just a domain-scope > variable. The variable is incremented accordingly, but only in > memory. My > thought was that it would be way, way too database-intensive to "Read DB > Row", "Increment Value", "Update DB Row" for (practically) every > visitor to > the site. Sure, the DB could handle it, but why put any > unnecessary stress > on the machine if it can be avoided, right? > > I have a separate TAF that commits that value to the DB, and I > hit that TAF > hourly from a Cron job. Because the variable is in domain scope, > I have to > hit that TAF with a wild-side URL (i.e. > http://jongrieve.net/cron/whatever.taf). As above, the \cron > folder is not > off the Web root; it is a virtual root that only allows requests from the > local machine. Try it -- you should be denied access to anything within > that path (and if you aren't; let me know, eh..? ;). > > Obviously, in this example, it's somewhat overkill; it wouldn't really > matter if someone forced that DB write to happen -- although it could > potentially be used to DoS that server by making it utterly > thrash the DB... > > Just my Tip 'o the Day... > > Jon > > > > > > -----Original Message----- > From: Jon Grieve [mailto:[EMAIL PROTECTED]] > Sent: 30 April 2002 4:30 > To: Multiple recipients of list witango-talk > Subject: RE: Witango-Talk: Cron Setup > > > > Right -- on NT4 you use AT. On Windows 2000 Server, you get the > much better > Task Scheduler. If you use AT on 2000, it actually creates Task Scheduler > items... ;) > > > -----Original Message----- > From: Troy Sosamon [mailto:[EMAIL PROTECTED]] > Sent: 30 April 2002 4:26 > To: Multiple recipients of list witango-talk > Subject: RE: Witango-Talk: Cron Setup > > > I use a batch file using the AT command to do things on a regular > schedule. > > Troy Sosamon > > > >===== Original Message From [EMAIL PROTECTED] ===== > >John, > > > >I use the Windows Task Scheduler for these kinds of things, > purely because > >the GUI is easier to work with when settings the timing. > > > >Using Task Scheduler, you can have it fire off a CMD file to perform the > >same task. In order to access a TAF file, I use the HTTPCMD utility from > >the NT Resource Kit, which is basically a text-mode HTTP Client (i.e. > >Browser). I suspect you could also use a Win32 version of Lynx (try > >http://lynx.browser.org/). > > > >Just my 2 pence... > > > >Jon > > > > > > > >-----Original Message----- > >From: John Shaw [mailto:[EMAIL PROTECTED]] > >Sent: 30 April 2002 2:24 > >To: Multiple recipients of list witango-talk > >Subject: Witango-Talk: Cron Setup > > > > > >Hello all, > > > >I'm on Win2k, IIS and can't get crontabfile to work. Here's what I have > >done. > > > >1. I set the crontabfile variable to > >C:\PVSW\Tango2000\Configuration\crontab.txt and restarted the server. > >* The docs say to specify the full path, but I wasn't sure if the file > >name should be included. > > > >2. Below I'll paste the contents of crontab.txt. Tabs are used as > >delimiters. > > > >3. > > > ># > ># Cron tab file > ># > ># Run this file every 15 minutes > >0,14,29,44,59 8-17 * * * http:\\www.pfmonline.net\cron_15_min.taf > ># > ># > ># Run this file every hour > >1 * * * * http:\\www.pfmonline.net\cron_hourly.taf > ># > ># > ># Run this file every week at 0001 Sunday morning > >0 0 * * 0 http:\\www.pfmonline.net\cron_weekly.taf > ># > ># > ># Run this file at the begining of each month > >0 0 0 * * http:\\www.pfmonline.net\cron_monthly.taf > ># > ># > ># That's all! > > > > > >________________________________________________________________________ > >TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > >________________________________________________________________________ > >TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > > Troy Sosamon > Denver Co > [EMAIL PROTECTED] > > ________________________________________________________________________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body > ________________________________________________________________________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body > ________________________________________________________________________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body > > ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
