README FOR chrec 2.2
--------------------
chrec (pronounced "c-h-rec", or "shrek" if you're feeling animated) is a simple
tool meant to record system changes in a flat text file. It's useful for
coordination of changes among multiple sysadmins, and for meeting SOx/ITIL/etc.
needs.
INSTALLATION
------------
In the Makefile, set INST_DIR to wherever you want the software installed. You
may also need to change the INSTALL command, depending on the location and
version of "install" on your system.
In addition, if the auto-figured location of the change log directory doesn't
work for you (if installed in the default /usr/local/bin/, the change directory
is /usr/local/var/changes/), then you can hard-code the location of $chDir in
the script.
Then run "make install".
USE
---
"chrec -h" prints out a usage statement. In its basic form, you follow the chrec
invocation with a list of hostnames on which a change has been made. You're then
prompted to enter a description of the change, which you conclude by entering
Ctrl-D on a line by itself. The change is recorded in a separate file for each
host, along with a date and user. The date and user default to the current date
and the invoking user (thus it's best NOT to run this as root or some other
generic user), but those can be overridden with command-line options. You can
also create a file with a change description, then specify that on the command
line.
Other command-line switches will undo the most recent change entry for the
specified hosts, and display the change logs for the specified hosts.
When making the same change to a large number of hosts, it's helpful if you can
feed the list to chrec from a pre-existing source. For example, you can combine
it with the rshall utility (also at ) to do
something like this:
chrec `rshall -l -s solaris -c patch`
to record a change for all Solaris hosts that were scheduled for patching.
chrec assumes that everyone making changes belongs to a common group, by which
the change directory (/usr/local/var/changes/ by default) is owned.
Here's an example run-through of chrec usage:
==========
% chrec -h
chrec 2.0
usage: chrec { -h | -V }
chrec [-u user] [-D date] [-f filename] hostname [hostname]...
chrec -U hostname [hostname]...
chrec -s hostname
-h: Prints this usage statement and exits.
-V: Prints version number and exits.
-u: Person who made the change. Defaults to current user.
-D: Date when change was made (as YYYY-MM-DD). Defaults to current date.
-f: File containing change description. Defaults to standard input.
-U: Undoes most recent change log entry.
-s: Shows the change log for the specified host.
% chrec krishna buddha
Enter description of change, ending with ^D on a line by itself:
Applied latest Software Update, then rebooted.
^D
Updating the following change logs:
/usr/local/bin/../var/changes/krishna
/usr/local/bin/../var/changes/buddha
% chrec -s krishna
############################################################
2007-05-31 leonvs (Leon Towns-von Stauber)
----------
Applied latest Software Update, then rebooted.
==========
PLATFORMS
---------
chrec has been written for portability to most UNIX systems. It's been tested on
the following platforms:
- Darwin/Mac OS X
- versions 7.x/10.3.x through 8.x/10.4.x
- Solaris
- version 9
CHANGES
-------
You're not required by the license to submit changes back to the source, but I'd
appreciate portability improvements or enhancements of general applicability.
You can email new versions or contextual diffs ("diff -c old_file new_file") to
. Some things to keep in mind if you do this:
- Formatting
- I use tabs for indentation, and sometimes to align code
segments for readability. Please do the same.
- Please don't use NotePad or some other Windows editor to make
changes. Or if you do, get rid of the DOS linefeeds
before submitting changes.
- Please try to follow the formatting conventions established
in the existing code.
- Readability
- Usually, I will trade off efficiency (of running time or of
development time) in favor of readability.
- Insert meaningful comments where appropriate.
- Portability
- All shell scripts are Bourne-compatible. I won't use shell-
specific constructs from bash, ksh, etc.
- Don't use OS-specific features, pathnames, etc., unless
they're guarded by code checking the OS version, or
they're in user-settable variables toward the top of
the script.
CONTRIBUTORS
------------
Leon Towns-von Stauber
Enjoy!
Copyright (c) 2006-2007. All rights reserved.
See the LICENSE file distributed with this code for restrictions on its use
and further distribution.
Original distribution available at .