NAME

gx-cleanup-logs - Clean up the requests.log file


SYNOPSIS

gx-cleanup-logs -help

gx-cleanup-logs -version

gx-cleanup-logs [options] [files]


DESCRIPTION

gx-cleanup-logs, part of the gx-map system, is an administrative command. It reads one or more existing requests.log files (or stdin if no file name is specified). It writes to stdout a merged requests.log file with redundant requests commented out or deleted.


OPTIONS

Option processing is done using the Perl Getopt::Long module.

Options may be specified with a single or double leading '-' character. Option names may be abbreviated to whatever is unique. Arguments may be separated either by a blank or by an '=' character. For example, ``-foobar 42'', ``--foobar=42'', and ``-foob 42'' would all be equivalent.

-help
Display a usage message and exit.

-version
Display the software version number and exit.

-merge-only
Merge and sort input records; don't delete anything.

-delete
Delete redundant requests (the default is to comment them out).

-sdsc
Delete requests for SDSC certificates without SOURCE=SDSC-CA. This is specific to the San Diego Supercomputer Center.

-debugging
Enable debugging output.


USAGE

The requests.log file can grow very large over time. Each request, entered either by a user or automatically, is appended to the requests.log file, which must be re-processed every time a new grid-mapfile needs to be generated.

In many cases, the requests.log file contains redundant information. For example, if a mapping is added and then removed, the ``add'' and ``remove'' requests could both be deleted.

The gx-cleanup-logs command is designed to remove redundant information from a requests.log file. It should delete (or comment out) all ``remove'', ``remove-user'', and ``remove-dn'' requests, leaving only those ``add'' requests that are currently active.

The gx-cleanup-logs command should be considered experimental.

There is currently no mechanism for applying this command automatically. If the size of the requests.log file hasn't become a problem, I recommend leaving it alone. If it does become a problem (i.e., your system is spending an inordinate amount of time re-scanning the file), you can carefully do the following:

1. Suspend the cron jobs (you don't want the system trying to perform updates while you're working on it).

2. Save copies of your existing requests.log file and of your grid-mapfile. Note the ownership and permissions for the existing requests.log file. Consider also saving a copy of a grid-mapfile generated by ``gx-gen-mapfile -all''.

3. Use gx-cleanup-logs to generate a new, smaller requests.log file from your existing one. You can use the -delete option if you want the resulting requests.log file to be as small as possible. By default, redundant information will be commented out; this should still save significant time, and the information can be valuable as an audit trail.

4. Use gx-gen-mapfile to generate a new grid-mapfile, and compare it to your previous one. You can also use ``gx-gen-mapfile -all'' if you saved a copy of the output of that command. If the ``before'' and ``after'' files are inconsistent, something went wrong. If it's a problem with the gx-cleanup-logs command, please contact the author.

5. If everything worked properly, make sure the new requests.log file has the same ownership and permissions as the old one and re-enable the cron jobs.


SEE ALSO

gx-map(7), gx-map-requests-log(5), gx-convert-log(8)


AUTHOR

Keith Thompson, San Diego Supercomputer Center, <kst@sdsc.edu>


COPYRIGHT AND LICENSE

See the file LICENSE in the gx-map distribution, installed in the etc/gx-map subdirectory.