A Simple Ruby Time Clock
January 28th, 2008
Doing freelance work, I often want to keep track of how much time I’m spending on a project and how I’m allocating it. I’ve always solved this problem by logging my time manually in flat text files, but I found that I’d often forget to document what I was doing or log my start time on a task and end up moving on to something else before remembering to log my end time. I always ended up doing a lot of estimation and lost valuable information about the work process.
I was thinking about this the other day and decided I wanted to automate things. I wrote a quick ruby script that manages one or more plain text files to keep track of all of this stuff automatically. It’s simple, command-line based, and somewhat crude, but it gets the job done. You run the program when you start to work, enter any important notes as you go, and type ‘done’ when you’re finished. The script automatically logs the time for each session and prints a total at the end of the file.
I figure other people might be interested in using it (I know the Moving Box guys are), so here it is for general consumption. Sorry, but for now it’s only for those who are comfortable on the command line. Run “log_time -?” to see the help message and learn how to use it, generally you won’t have to throw it any options except maybe the log file to use and/or a message saying what you’re working on. The only requirement is a fairly recent version of Ruby. You may have to make the script executable depending on your OS. Enjoy!
Contact Me
January 1st, 2008
You can use the following form to send me an email: