Tuesday, September 15, 2009

Keeping a Worklog

Keeping a personal worklog can be a great help for any system administrator. A worklog will track changes you make and become an excellent resource while troubleshooting problems or trying to justify the need for extra help (or a raise).

Worklog entries can be based on time of day or deltas. Time of day entries are noted during a certain time interval (ex. 15-60 minutes). These can be used to update a regular status check and a good way to break up a long work schedule. A delta is a change or an event that causes a change. I prefer to keep a log of deltas. My work is interrupt driven, after I do something I don't want to think about it anymore, it's done and I need to move on.

There are many different tools that can be used as a worklog. Whatever you use, make sure that the tools complexity is so trivial that it becomes a habit rather than a process. Your tool should be as small and consistent as possible. The goal being to create a worklog that is easy to search, update, and modify.

The simplest form of log that I currently maintain is a text file. The format is very simple; each line contains three fields, (1) date, (2) time, and (3) the entry.

I insert a date and time stamp on every line to make searching easier. I search it (with grep or any full text system search), change it (with sed or any find and replace), and even port it to other formats (like csv, html, or a database).

I've kept worklogs in many different ways: paper, text files, even a personal wiki. When deciding on what tool to use, don't look for perfection, you'll never find it. Instead, look for sustainability. If you worry about every possible outcome or use for your worklog, you'll never keep a consistent one.

I use a modified version of a script under Windows (my version is below), and emacs (with worklog.el) under Linux. I used to keep my worklog on a thumb drive, but now I use a dropbox account (referral link) to sync my worklog files across multiple machines.

Finally, if groups of administrators keep these small change logs in plain text, a tail program can be used to monitor changes and actions in real time. In effect these logs become a local-simple to use-version of twitter.

Windows batch file:

rem save as w-logger.bat
rem From: http://blog.enrii.com/2006/08/02/simple-task-logging-tool-for-windows/
@echo off
cls
echo.
set /p m=Task:
echo %DATE:~-4%-%DATE:~-10,-8%-%DATE:~-7,-5% %TIME:~0,5% %m% >> worklog.txt

~/.emacs additions:

;; download worklog.el, into /usr/share/emacs/site-lisp
(require 'worklog)