As I wrote earlier, I use worklog to keep track of my time.  I use some other scripts to help manage worklog's output, and now that I made one of the scripts work even nicer today, I figured I should post them.

I use get-time to see where I spent time on a particular day. It defaults to today, but you can give it an argument like "yesterday", "-2 days", "last thursday", etc.  Now that it runs without user interaction (courtesy of expect) I have added it as a cronjob to email me at midnight with the previous day's work.

I use get-all to show me all work done since I first started using worklog.  Now that I have been running it for more than a year it might not be as useful as it once was, since the average is probably different from the max and min, which might be more interesting (and maybe a future shell scripting project)

get-summary isn't intended to be run by itself, though I suppose there might be some use for it - showing you how much work you have done this month, or something like that.  (Oh - I just realized that I might be using worklog differently than some people - I make a new directory for each month, and move the files at the end of the month -- and now that I have this handy expect script, I could probably automate the whole thing, and email it to Heather, so she wouldn't have to ask me to do it any more...)

Note, to get worklog to run in a cron job, you'll need to add a TERM=dumb bit, otherwise worklog won't output its time.log file at all - something to do with cron's tty not being set.  Quite frustrating to figure out after spending an hour with a script that worked from the command line, but not from the cron.

Scripts: get-time get-all get-summary

Posted by Jon Daley on December 8, 2008, 3:25 pm | Read 2112 times
Category Programming: [first] [previous] [next] [newest]

Wow, Jon, I didn't know you were bilingual!

Posted by Stephan on December 11, 2008, 3:12 pm

Hrm - you've stumped me. I assume that "worklog" means something, but I can't find it.

Posted by jondaley on December 11, 2008, 3:15 pm

No, I just meant that although it looks like English, my handle on some of the sentences is shaky at best...

Posted by Stephan on December 11, 2008, 3:16 pm

Ah, yes - that kind of bilingual - yes, I suppose if you count programming languages, I speak a whole bunch of languages. I seem to be able to learn them much easier than languages that people speak in other countries.

Posted by jondaley on December 11, 2008, 3:19 pm

They're international - if you're abroad and in a pinch, try talking to your interlocutor in C++! ;-)

struct family {
char father[40];
char mother[40];
char child1[40];
char child2[40];
char child3[40];
char child4[40];
char child5[40];

family daleys;

int main() {
ticket (daleys);
tram (daleys);
return 0;
Posted by Stephan on December 12, 2008, 1:16 am

The trouble with that language is that it looks like spam (which is why your comment didn't appear until now). And it also needed some
tags to make the carriage returns work correctly.

Though, I am not sure why it needed those.

I do understand why it lost whatever include file you added, since the commenting parser doesn't understand C++, so thought you were writing an offensive term in HTML, and removed it.

Posted by jondaley on December 12, 2008, 9:25 am

Sorry - I figured it was something like that when it wouldn't show up. The include file was called pubtrans dot h, though I don't think the comment lost a lot when it lost that.

I don't think there were any good carriage returns. I'm basically a phrasebook programmer, so I just copy-pasted from some online tutorial site.

Hello World!

Posted by Stephan on December 14, 2008, 10:17 am
Add Comment
Add comment
E-mail me when comments occur on this article