Linux Training

Linux training for private, public & voluntary sector.

0793 572 8612

City LinUX sample scripts - webupd


webupd - updates the awstats statistics pages and the dig search indexes for an arbitrary number of websites on a remote server.


webupd [[ -S ] [ -c <config_file> ] [ -d ] [[ -h ]|[ -s ]] [ -v ] <host_name> ] | [ -V ]


webupd is a Bourne shell script which should work equally well on all versions of UNIX and Linux.


The webupd uses the <host_name> to look up the path to the web pages and the name of the configuration files for dig and awstats. A ssh connection is made to <host_name> and the awstats perl script is run to update the stats data set and generate static web pages for each web site.

The dig script rundig is then invoked to update the search data with any changes that have been made to the web pages.


-c <config_file>
Allows a configuration file to be identified on the command line rather than using the default " /usr/local/etc/ ".

-S    Use static links when generating awstats web page.

-d    Run in debug mode.

-h    Update htdig only.

-s    Update awstats only.

-v    Run in verbose mode.

-V    Print the version details to standard out and exit.



webupd  caswallon-gw 

The script will look for the configuration file in the default location i.e. /usr/local/etc/ .

NB. The site names are abreviated in the example configuration file and appropriate alternative short path names are provided as symbolic links on disk. These sites could equally well have been written as "" "" etc. provided that the paths are available e.g. "usr/local/web/".


The script has very little input error checking. The script is designed to be used with cron where the resolution of the symbolic hostname is predictable. It is assumed that ssh keys have already been exchanged and that the connection will be non problematic.


Clifford W Fulford, City Linux. Contact or call +44 (0)709 229 5385.

The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.