magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 05 > Help Desk  

Help Desk

By John Mark Walker, Guest Webmaster

Daisy-Fresh Content

Dear Help Desk,
Is there any way to get your Web server to email the Webmaster when a page on your site has not been updated after a certain amount of time? I'd like to be sure that our site content is always up to date.
- Scott

Dear Scott,
This isn't the sort of functionality normally associated with Web servers. However, assuming you're serving pages in a UNIX or UNIX-like environment (as any competent admin should) there is hope in the form of cron scripts and a file called crontab. This is the UNIX way to do any sort of system monitoring at regular time intervals, as specified by the administrator.

We'll start with the crontab file. On my Web server, a highly modified Red Hat Linux 6.0 machine, crontab is found in the directory /etc. For other UNIX systems, if you don't find crontab in /etc, you may want to issue the command man crontab or man cron to find out where it's located.

We'll add a line to crontab so that it will run a Perl script named web_update.pl every day at a specific time, checking the last update to a Web page. In this case, we'll choose every night at 11 p.m., but you can choose any time interval that makes sense for you. Remember that the crontab file is in the following order: minute hour day month year user command. Since we don't care about the specific day, month, or year, we've inserted * in their place. For the user column, we've designated this script to be run by root.

# Web server check
0 23 * * * root /path/to/perl /path/to/web_update.p



  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2