[Remind-Fans] how to keep .reminders file clean?

Daniel A Graham daniel.graham at duke.edu
Mon Feb 4 14:57:50 EST 2008


On Sun, 27 Jan 2008 17:37:41 +0100, Martin Walk wrote:
> hi,
> how do you keep your .reminders file clean:
> how do you remove expired one-time reminders from the file?
> is there a mechanism for that in remind or do you have to do it manually?
> thank you for answers, martin.
> _______________________________________________
> Remind-fans mailing list
> Remind-fans at lists.whatexit.org
> http://lists.whatexit.org/mailman/listinfo/remind-fans

Here's an approach that currently works for me.

Create reminder files for each month, 01-Jan, 02-Feb, etc, and INCLUDE 
them in your ~/.reminders. Then once each month (using remind's RUN, of 
course) execute the following shell script:

#!/bin/bash
# archive contents of this month's reminders file and link it to the 
file named 'current' in
# your monthly reminder files directory:
monthlyreminders='/Users/dag/Documents/Reminders' 		# edit to suit
cd $monthlyreminders
thismonth=`date +"%m-%b"` 						# e.g., 02-Feb
thisyear=`date +"%Y"`							# e.g., 2008
backup=$thisyear-$thismonth						# e.g., 2008-02-Feb
# Have we already archived this month's file?
if [ -e $backup ]; then
    echo $backup already exists - canceling
else
    mv $thismonth $backup && touch $thismonth
fi
# link this month's file to 'current'
ln -sf $thismonth current
cd -

Now if you write your one-shot reminders to file named 'current', 
you'll have backups of them by year and month but only the last year's 
worth will actually be included in your ~/.reminders.

-Dan



More information about the Remind-fans mailing list