nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] remove files written by mhstore

2013-02-25 05:53:18
Hi Joel,

I unpack to files using mhstore.
...
It would be nice if there were an mhunstore, or a -remove flag for
mhstore, for cleaning up the files written my mhstore.

The way I handle this, outside of nmh, is with my td definition, for
temporary directory.

    $ type td
    td is a function
    td() 
    { 
        td=$T/`date +%s.%N` && mkdir $td && cd $td && pwd;
        (($#)) && echo "$@" >README
    }
    $

$T is one of my environment variables.  It's the location of a `/tmp'
for me to use.  In my case, /home/tmp, which is big and doesn't get
cleaned on boot.

    $ td
    /home/tmp/1361792765.747570620
    $ mhstore
    storing message 6481 as file 6481.txt
    $

$td is set in that shell so I can pop back there as I move around, or to
cp things there easily.

I've then a whole load of directories under /home/tmp.  If I remember, I
remove the files as I finish with each one, which is just a `rm *'
having checked where I am.  I do `rmdir 1*' for /home/tmp occasionally,
which leaves behind non-empty directories.  `ls 1*' has their contents
whizz past, the latest at the bottom, handy for when I want to go back
to one from a day or two ago, e.g. because an email's turned up
continuing a conversation.  It also makes it easy to pick and choose
what ones to remove with `rm -r' without changing into each.

I did this because I was fed up with having a bunch of directories with
various poorly-thought-out names that was tedious to try and clean up
periodically.  At least this way, each only contains one activity.

Cheers, Ralph.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>