If you just want to see how much time you spend logged-on why not look at the output of "last"? I suspect you want more detail than this, though.
Your statement "...ways of tracking time spent in shell for Linux system administration." gives me pause. That almost sounds like you're looking for some kind of automatic method of identifying what you're working on and logging the time.
I'd hypothesize that the amount of time you'd spend building and maintaining some kind of "AI" to analyze your commands and track time would dwarf the amount of time you actually spend on sysadmin duties. How does that tool know why you're tailing "/var/log/messages" today?
I work time-and-materials for all my Customers and have to keep fairly detailed logs of my activities and times. If there's a shortcut out there I'd certainly love to find it, but my methodology is, I expect, the only one that makes realistic sense:
- Log start and stop times for given activities
- Try to minimize interruptions to those activites and, when interrupted, log myself off that activity (and hopefully on to something else billable)
- Categorize time associated with a given activity and write notes
- Repeat ad infinitum (billing, where possible and appropriate!)
Lately I've been using an iPhone app on my iPod, HoursTracker, but previously I used such software as Notepad and Pieces of Paper with Writing on Them(tm). I don't see any reason why you couldn't use a simple shell script to append times and log details to a database, flat file, etc. You could probably su to different accounts prior to starting different admin activities so that you had a record of start / stop times on activities. Whatever you do, the usage methodology is a lot more important than the tool you use to gather data.
If you want to get good per-task times you're going to have to have the discipline to log when you start and stop working on a given task. If you want to get a good handle on your Samba-related admin time, you'll have to be sure to log yourself off of that task when you're doing Apache work, playing Server Fault, etc.
Like I said-- I'd love to find a shortcut. Some kind of brain-computer--GPS-telephone interface would be awesome, but it just doesn't exist that I've been able to find.