Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
112 lines (91 sloc) 4.21 KB


Now and then I see an app online where I realise it's a mainstream version of something I've created for myself. The new thing will have a friendly interface but tradeoffs I'd be uncomfortable with, such as giving someone else important data. Mine will be textual, and retain control of my data.

This entry is about a tool called saga, which has a similar purpose to evernote.

When you work on lots of projects and across multiple computer systems, it's really easy to lose data.

I generally think about data chronologically. I might forget the name I gave a project, but remember that I was working on it in August around the same time as another project that I do remember.

Saga creates directories which are named so that when you sort them all you get them back in chronological order.

Basic usage:

$ saga         # default usage echos the complete list of files
$ saga test    # this creates a new directory and echo the filename
$ saga -z      # echos the name of the most recently created dir
$ cd `saga -z` # dash z is useful for cd
$ pwd

Structures underneath:

$ cd $HOME/saga
$ cd saga
$ ls -lF
drwxr-xr-x  2 cturner cturner    4096 2011-10-31 17:21 20111031.cturner.bump.aa.python.twisted.standardio.insults/
drwxr-xr-x  2 cturner cturner    4096 2011-11-08 07:08 20111108.cturner.bump.aa.freepascal/
drwxr-xr-x  2 cturner cturner    4096 2011-12-05 22:39 20111205.cturner.bump.aa.curses.client/
drwxr-xr-x  4 cturner cturner    4096 2011-12-21 13:45 20111221.cturner.bump.aa.golang/
drwxr-xr-x  5 cturner cturner    4096 2011-12-26 15:18 20111226.cturner.bump.aa.roguelike.messaround/
drwxr-xr-x  3 cturner cturner    4096 2011-12-30 17:23 20111230.cturner.bump.aa.moria/

If we created another example for today, it would have 'ab' in the filename in place of 'aa' to retain order by creation time. This example is taken from a mostly inactive computer, so you can't see that in this example.

Note that we don't have to worry about the write-date of any of the directories. If you consolidate saga directories from several systems into one, you'd retain this.

I created this system originally because on any given day I'd deal with data from multiple customers and wanted to have perfect retention with a responsive system. No web bug tracking system could match this for speed. However, I've also found it very useful for capturing code snippets.


$ saga | grep python
$ ls
$ cat
# start with twistd -noy
import os, tty, sys, termios

from twisted.application import service

from twisted.internet import reactor, stdio, protocol, defer
from twisted.python import failure, reflect, log
from twisted.protocols import basic

You don't actually need any code to use the saga approach. In the early days I had no script. Then I created a shell script to help me out. Then I moved to python, and later added username and hostname.

The downside of this system is that it gives you more typing to navigate around the filesystem. Tab completion gets jammed on the year and you see lots of results. Some other time I'll write about another tool I've written to sit on top of this called silo. It solves the verbosity prooblem from several angles and allows for tagging. It uses symbolic links and doesn't introde on the silo foundation.


You can’t perform that action at this time.