(Generate nightly reports from the AFS database)


afsdb-reports [-hmv]


Run a series of nightly reports from the data in the AFS database and print the results to standard out, or mail them to afs-reports at if the -m option is specified.

The reports are all contained in this script. To add a new report, add a new entry to the @REPORTS array at the top of the script, specifying the heading, the SQL query to run, and a reference to a sub to process and print out each line of the results. The sub will be called repeatedly for every returned row and be passed all of the data elements returned by the query for each row as parameters.


-h, --help

Print out this documentation (which is done simply by feeding the script to perldoc -t).

-m, --mail

Mail the report to afs-reports at rather than printing it to standard output.

-v, --version

Print the version of afsdb-reports and exit.


Orignally written by Neil Crellin <>. Rewritten by Russ Allbery <> and Jonathan Pilat <> to use the Stanford::LSDB::AFSDB module, to include all of the reports in the script, and to simplify, improve, and optimize the SQL.


Copyright 1998, 2001, 2004, 2005 Board of Trustees, Leland Stanford Jr. University.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.


The current version of this program is available from the AFS reporting database software page at <>.

Last spun 2014-08-10 from POD modified 2010-07-07