Archive for the ‘GTD’ Category

Backup script for ToodleDo

Tuesday, August 10th, 2010

Just started using ToodleDo with the GotToDo Android app on my HTC Desire.

There is a rare bug in the app which has deleted all the ToodleDo tasks for a very small number of people. the author of the app is working on a solution at the moment, but in retrospect I should have had a backup plan for this data anyway.

Benny Morrison on the app mailing list sent me a DOS script he used to back up his Toodledo account, and I have hacked it to work under linux (the core functionality comes from Benny – all I did was wrap it up in some linux specific stuff to create the appropriate directories and do some rudimentary checking).

The (short) script is below. I run this from a cron job a few times a day.

Pete

#!/bin/sh
# Script to backup toodledo account
# makes a backup on your local machine and
# sends a copy to a google account of your choice
## CONFIGURATION SECTION
## CHANGE THESE VARIABLES ONLY
#
# Where you want the data stored.
DATADIR=/home/YOUR-NAME-HERE/toodledo-backup/$(date +%Y)/$(date +%m)/$(date +%d)/$(date +%H:%M:%S)
LOGIN="TOODLEDO-LOGIN"
PASS="TOODLEDO-PASSWORD"
# This variable is where you want copies of the backups sent. I use a dedicated gmail account.
ARCHIVEMAIL=ARCHIVE-EMAIL-ADDRESS
#
## END OF CONFIGURATION SECTION
mkdir -p $DATADIR
cd $DATADIR
wget -q --no-check-certificate --keep-session-cookies --save-cookies cookies.txt --post-data "email=$LOGIN&pass=$PASS" https://www.toodledo.com/signin.php
wget --quiet -O Tasks.xml --load-cookies cookies.txt http://www.toodledo.com/xml.php
rm cookies.txt
rm index.php
#
## Check for login errors
if [ -f signin.php ]
then
echo "$0 - ERROR - login not complete.
There is a HIGH RISK that your ToodleDo backup did not complete."
fi
#
## Does the Tasks.xml file look OK ?
if ! egrep -q '' Tasks.xml
then
echo "$0 - ERROR - Problem with Tasks.xml file.
There is a HIGH RISK that your ToodleDo backup did not complete."
fi
## Now mail the file to a google account
/usr/bin/mutt -s "ToodleDo backup - `/bin/date`" -a Tasks.xml -- $ARCHIVEMAIL < /dev/null

org-mode, GTD, and the advantages of merged lists (i.e., context)

Wednesday, July 1st, 2009

David Allen (DA) in Getting Things Done (GTD) talks about the necessity of the separation of projects and next actions.

It’s a good point well made. In the past I have struggled with project pages in a Dayrunner which had merged project plans, meeting notes and next actions. To understand what next action I had to do for that project meant looking in the pages for that project and picking out the NA. Even if coded with an NA in the margin, picking out the appropriate next action from dozens of projects was difficult.

The downside of doing this is that when you have performed your next action, you may want/need to look at the project to determine the next action. Separate project lists and action lists mean that you have to switch contexts – for example between a list of projects in a computer database and a PDA, or a project folder and a Hipster card.

One of the advantages of emacs org-mode is therefore that you *can* merge your projects and actions in one place, but you can also pull out the next actions easily.

In org-mode, all of my projects are a three-star heading:


----------------------------------------------------------
* Projects
** A
** B
........
** S
*** Standards Committee XXX
**** notes of meeting held on March 1st 2009
Present: Mike, Pete, Jim
Agreed xxx xxxx
Blah blah blah.
***** WAITING Mike to review
***** NEXT organise next meeting of committee :Laptop:
Send email from committee site to members asking for availability for meeting.
----------------------------------------------------------

The advantage of this is that when I go to deal with a next action, there is *context* available to me relating to that action – I can see what I’ve done, with whom, etc, and take that into consideration.

It also means that when I complete the action, I am in the right location to decide the next ‘next action’ – again – I have context available to me to help me make an informed decision.

In my view, this still meets DA’s requirements of separation – org-mode can easily produce lists of Next Actions I need to do at my laptop, or all of my ‘WAITING for’ items, but because managing separate lists means switching contexts, it is a smoother, more fluid, process.

Now I do understand that what I am creating here is a data silo in my laptop, which I am unlikely to have with me when I am out and about. I haven’t clarified my thinking on that yet – I also use a Nokia N810 which may be the solution. However, my requirement for context specific lists for things I need to to when away from my laptop (:DIY:, :Shopping: etc) is small enough that I usually generate the list on the laptop before I leave the house and write it down or print out the buffer.

GTD b..y with emacs org-mode

Monday, May 5th, 2008

On GTD Times today there is a discussion about Kelly Forrister’s Mastering Workflow seminar, and an illustration of thinking about projects from a…z.

The post describes the project as ‘Z’, and your next step as ‘A’, and discusses how you document any other steps which may need to be done *after* your next action to get to ‘Z’ (i.e., project completion). There are some ideas about where you store these extra ‘next next’ steps.

Because emacs org-mode allows you to turn a heading or bullet point into a next action through a simple key combination (^C^T) I find that something along the following lines works well for me:

* WORK
** Project A
*** DONE Create project costing :Laptop:
*** NEXT Ring Jim to check the costings are OK. : Phone:
*** Check we can fit the project into June/July :John:
*** Hand project over to John
*** Check project progress
SCHEDULED: <2008-6-30 Mon>

As you can see, the beauty of org-mode is that

  • you can store everything related to a project together (which was one of the discussion points in theGTD Times post)
  • both my next steps and ‘next’ next steps are visible to me when I do my weekly review.
  • Only the NEXT action will come up when I use the appropriate key combo (‘^Cas’ in my case, which is one of my org-agenda-custom-commands and pulls up anything which is a NEXT action and which has a work-related tag, such as :Laptop: etc).
  • finally (and this, i think, illustrates why org-mode works so well), when doing the weekly review, if I have made the phone call, I hit ^C^T on the NEXT line to convert it to DONE, and then make a decision if one of the other steps is a next action. If it is, just move onto that line and hit ^C^T. Seamless.

Now the post also discusses the problems with cluttering up your lists with stuff you don’t need to focus on at the moment, but with org-mode this isn’t an issue as you can set up your various filters to show you as much or as little as you want.

mh-e article referenced on GTD times

Sunday, April 27th, 2008

Oliver Starr over at GTD Times has posted about my mh-e article. ‘Cool beans’ as my brother would say!

using mh-e under GTD

Sunday, April 20th, 2008

mh-e-gtd

1 Introduction

One thing you need to get to grips with when using GTD is the

  • Collect,
  • Process,
  • Organise,
  • Review,
  • Do

cyle.

This article focuses on how mh fits into this part of the equation for
me with the email part of my GTD. I use org-mode (another emacs mode)
for maintaining my lists, and find mh-e and org-mode work quite nicely
together.

I’m assuming that if you are using MH and mh-e under linux/unix etc,
you need no introduction to shell scripting, cronjobs etc.

1.1 Principles

When I go through my inbox in the morning I usually have around 60-80
emails which have collected overnight. These are a mixture of system
messages from our servers, a small number of low volume mailing lists
which I want to see daily (mh-e, org-mode, linux-thinkpad), and the
rest are emails from people I work with (from the same organisation,
from other organisations within the NHS, or from our commercial
customers).

Using the two minute rule, I deal with each email using one of the
following options:

  1. read and delete;

  2. read and file (no further action required, but want to keep for reference);

  3. read and reply (if can do in less than 2 minutes), followed by
    delete, file (for reference) or file for followup (see later);

  4. file into @today folder for emails which I need to deal with but
    will take more than 2 minutes. When I have finished going through
    my inbox, the @today folder is usually the next one I look at as I
    know there are emails there which need dealing with;

  5. file into +pending/tonight – usually personal emails I want to get
    out of my way so I can deal with them at home in the evening.

  6. file into one of my pending folders – these are for emails which:

    a. I can’t do anything about now (for example, I need to be in
    the lab to deal with, and won’t be there for a few days);

    b. are time dependent (agenda for a meeting, which I want to come
    back to me the day before the meeting);

    c. I want to cogitate about (a difficult email I want to think
    about for a few days before replying)

    d. I’m waiting for a response on – for example, if I send an email
    asking somebody to do something, I either put a note into my
    lists for that person, so I can check the progress when I next
    see them, or I may think that I would like to see that email
    again in a months time back in my inbox.

Some ‘time management’ methodologies say that you should only handle
each piece of paper (or email) only once. However, I have no problems
with seeing emails (or pieces of paper in fact) multiple times – it is
no different from reviewing your lists on a weekly basis in my
opinion. I know that sometimes I will be smarter in a few weeks or
even a few months time, and want emails to be automatically picked up
from their pending location and popped back into my +inbox at that
stage. Therefore I set them to ‘incubate’ in one of my pending
folders, knowing that they will be brought to my attention at a time
of my choosing.

So with the principles out of the way, here is how I do this.

1.2 Setting up your folders

The following commands will set up your basic set of folders for you:

 folder -create +@today
 folder -create +pending
 folder -create +nextweek
 folder -create +tonight
 folder -create +tomorrow

 for (( f = 0; f < 32; f += 1 )); do
 folder -create +pending/d$f
 done

 for i in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
 do
 folder -create +pending/$i
 done

 for i in Sunday Monday Tuesday Wednesday Thursday Friday Saturday
 do
 folder -create +pending/$i
 done

1.3 The crontabs

Using crontabs is the key to making all of this work.

This is my crontab:

 # m h  dom mon dow   command
 # minute (0-59) hour (0-23) day of month (1-31) month (1-12)  day of week 0-7 (0 or 7 is Sun)
 PATH=/bin:/usr/bin:/usr/bin/mh
 HOME=/home/pete
 # run this every saturday morning at 1:10 am
 # see http://rand-mh.sourceforge.net/book/mh/e-rmmer.html
 10 01 * * 6 /usr/bin/find /home/pete/Mail/DELETE -mtime +10 | /usr/bin/xargs /bin/rm
 #############################################################
 #  Mail Section
 #############################################################
 ### Each month, refile all the pending stuff back to my inbox.
 ### 1:10 on the first day of each month
 10 4 1  * * $HOME/bin/monthly-pending
 ### Each monday refile all the next-week stuff
 15 4 *  * 1 $HOME/bin/weekly-pending
 ### Each day also has its own pending - Saturday, Sunday etc
 20 4 *  * * $HOME/bin/day-of-week-pending
 ### Each date of the month (1-31)  also has its own pending - d1, d11, d31 etc
 25 4 *  * * $HOME/bin/day-pending
 ### Each night at 17:30 - refile all pending/tonight to inbox
 30 17 *  * * $HOME/bin/tonight-pending
 ### Each night at 12:30 - refile all +today stuff back to +inbox
 40 01 *  * * $HOME/bin/today-refile-to-inbox
 # Each day refile the tomorrow pending back to +inbox
 35 4 *  * * $HOME/bin/tomorrow-pending
 #############################################################
 # email reminders about checking the various daily files
 # (physical, not email folders) I need to check - the 31 folders.
 #############################################################
 35 6 * * * /bin/echo "Check your black folder - stuff for lab." | /usr/bin/nail -s "check black folder - stuff for work ?  stuff to file ? receipts for office etc ?" pete@smtl.co.uk
 35 6 * * * /bin/echo "Check your daily files." | /usr/bin/nail -s "check daily files" pete@smtl.co.uk
 # index mail every hour. YMMV!
 30 * * * * /usr/bin/mairix -f /home/pete/Mail/.mairix/config 2>/dev/null

Note that I also use the rmmer scripts so that when I delete emails,
they are actually moved to +DELETE, and only deleted from there when
they are 10 days old by one of the cron jobs.

http://rand-mh.sourceforge.net/book/mh/e-rmmer.html

1.4 The shell scripts

These are very short shell scripts. You could proably stick them
directly into your crontab if you preferred.

1.4.1 monthly-pending

 #!/bin/sh
 # shell script to be run monthly which will take all pending stuf
 # from this months folder and stuff into inbox
 refile -src +pending/`date +%b` all  +inbox

1.4.2 weekly-pending

 #!/bin/sh
 # shell script to be run monthly which will take all pending stuf
 # from this months folder and stuff into inbox
 /usr/bin/mh/refile  -src +pending/nextweek all  +inbox

1.4.3 day-of-week-pending

 #!/bin/sh
 # shell script to be run monthly which will take all pending stuf
 # from this day's folder and stuff into inbox
 refile -src +pending/`date +%A` all  +inbox

1.4.4 day-pending

 #!/bin/sh
 # shell script to be run daily which will take all pending stuf
 # from this day's folder and stuff into inbox
 # these mailboxes are labelled +pending/d1 - +pending/d31
 refile -src +pending/d`date +%-d` all  +inbox

1.4.5 tonight-pending

 #!/bin/sh
 # shell script to be run daily which will take all pending stuf
 # from this folder and stuff into inbox
 /usr/bin/mh/refile  -src +pending/tonight all  +inbox

1.4.6 today-refile-to-inbox

 #!/bin/sh
 # shell script to be run daily which will take all emails from the today
 # folder and stuff into inbox
 /usr/bin/mh/refile  -src +@today all  +inbox

1.4.7 tomorrow-pending

 #!/bin/sh
 # shell script to be run daily which will take all pending stuf
 # from this folder and stuff into inbox
 /usr/bin/mh/refile  -src +pending/tomorrow all  +inbox

1.5 How does it all work ?

So every day, I process my emails. I deal with emails in +@today later
in the day, but if I don’t get to them (something else comes up which
takes priority), they all get filed back into my +inbox during the
night. This is because the next day my priorities will have changed so
an email I thought I should deal with may now be one I need to delete.

If I file an email now (April) into +pending/November, then on the 1st
November, the crontab will refile it back into +inbox.

This is the same for all of the pending files – emails will stay in
the apporpriate folder until the crontab picks it up at the
appropriate time and dumps it back into +inbox.

If you have read GTD, you will probably recognise this as the 42
folders principle – each day you open the day folder and dump it into
your in-tray, and each month you dump the contents of that into your
in-tray and then process.

1.6 Other folders

These are my other top level folders:

1.6.1 +Contacts

In here I will have folders for anybody I receive emails from

 +Contacts/bill.wohler
 +Contacts/carsten.dominik
 +Contacts/joe.smith

I have around 1,400 folders in here

1.6.2 ‘+OUT_MAIL’

I have a custom header added to my emails in my components and
repl.comps files etc, so that every single email I send has the
following header:

 Dcc: pete@smtl.co.uk

See http://rand-mh.sourceforge.net/book/mh/hea.html for details.

This makes our mail server send the email back to myself, where
procmail can pick it up and file it according to a set of rules. The
most basic one is:

MONTH=`/bin/date +%b`
YEAR=yr`/bin/date +%Y`
RCVSTORE=/usr/lib/mh/rcvstore             # rcvstore location

 :0
 * (^Received: from lap1.smtl.co.uk.*)
 {

 :0
 * (^To:.*jim.smith@domain.net.*)
 | $RCVSTORE +Contacts/jim.smith

 [other rules go here]

# Otherwise, stick in OUTMAIL, filed by month/year ...

 :0 E
 * .*
 | ${RCVSTORE} +OUT_MAIL/$YEAR/$MONTH
 }

which checks if it is an email I sent from my laptop, and if so
assumes I have routed it back through procmail so it can be
filed. After going through rules which automatically file emails into
person specific folders, anything else just gets filed in an outbox by
year and month.

Note that you will have to check whether your MTA supports the Dcc
header. We use postfix, which is OK, and previosly used sendmail,
which also supported this.

1.7 Mailing Lists

I belong to around a dozen mailing lists, some of which are high
volume. I don’t have these funneled into my +inbox – using sieve, they
go into list-specific folders on our imap server, and I scan them
around once a month. I would recommend that unless you belong to
mailing lists which are mission critical to your work or projects, do
not have them delivered to your +inbox, as it makes the processing
phase take way too long. You want to be able to process your +inbox
in 30-60 minutes if you can.

$Revision: 1.2 $

Author: Pete Phillips
<pete@smtl.co.uk>

Date: 2008/04/20 16:00:18