We’ll close this chapter with a brief look at a nice utility that
can be useful for keeping track of how you spend your time, information
that system administrators will find comes in handy all too often. It is
plod and was written by
Hal Pomeranz (see http://bullwinkle.deer-run.com/~hal/plod/). While there
are similar utilities with a GUI interface (e.g.,
karm, from the Gnome and KDE window manager
packages, respectively), I prefer this simpler one that doesn’t require
a graphical environment.
plod works by maintaining a log
file containing time stamped entries that you provide; the files’
default location is ~/.logdir/yyyymm, where yyyy and mm indicate the current year and month,
plod log files can
optionally be encrypted.
The command has lots of options, but its simplest form is the following:
If some text is included on the command, it is written to the log file (tagged with the current date and time). Otherwise, you enter the command’s interactive mode, in which you can type in the desired text. Input ends with a line containing a lone period.
Once you’ve accumulated some log entries, you can use the
options to display them, either as continuous output, piped through a
paging command like
less is the default), or via an
vi is the default). You can
specify a different paging program or editor with the PAGER and EDITOR environment variables
You can also use the
plod log files; it differs
grep in that matching entries
are displayed in their entirety. By default, searches are not case
sensitive, but you can use
-g to make
Here is an example command that searches the current log file:
plod -g hp-ux----- 05/11/2001, 22:56 -- Starting to configure the new HP-UX box. ----- 05/11/2001, 23:44 -- Finished configuring the new HP-UX box.
Given these features,
be used to record and categorize the various tasks that you perform. We
will look at a script which can read and summarize
plod data in Chapter 14.