Saturday 2 October 2010

A Simple Reminder System

This is a continuation of my post on running a paperless office.
Ever faced with the problem of constantly forgetting important events, missing bill payments or forgetting anniversaries? Don't want to publish billing information onto an online calendar? This  simple email reminder system seemed the most versatile. This is how it works:
The solution centres upon the calendar(1) command from the bsdmainutils package. It takes a simple formatted text file as input, and displays events within a user specified number of days forward from today. The format is really easy maintain a list of birthdays, or of bills requiring payment. Create a file called ~/.calendar/calendar. The file will contain entries like:
#ifndef _calendar_frank_
#define _calendar_frank_
LANG=en_AU
#include <calendar.australia><calendar.australia>
#include <calendar.birthday><calendar.birthday>
#include <calendar.reminder><calendar.reminder>
#endif
And this is what a the calendar.australia file looks like:
/* Australian holidays $FreeBSD$ */
#ifndef _calendar_australia_
#define _calendar_australia_
LANG=UTF-8
/* Australia */
Jan 26 Australia Day Holiday (Australia, except NSW, Vic)
Mar/SunLast Daylight Savings Time ends in ACT, NSW, SA, TAS and VIC.
Apr 25 Anzac Day (Australian and New Zealand Army Corps) Day (Australia)
Jun/MonSecond Queen's Birthday Holiday (Australia, except WA)
Oct/SunLast Daylight Savings Time starts in ACT, NSW, SA and VIC.
/* Victoria */
3/MonSecond Labour Day (Vic)
Nov/TueFirst Melbourne Cup (Vic)
#endif
In the same fashion, the calendar.reminder is formatted with a month, day and finally a description. The descriptions follow a standard pattern so that you can quickly identify billing information. It also means that the reported entries are standardised.  My suggested formatting is:
Mon dd Bill Title: bill code, Reference: 9999, Amount: $000.00, Receipt:
When the bill is paid, append the receipt id, then comment out the line.  Commenting it out prevents you being reminded for a bill you've already paid:
/* Feb 23 Telephone: TLS123, Reference: 456, Amount: $11.30, Receipt: 7890123 */
So a single reminder file contains current and historic information. Which is useful if you wish to see how bills change over time. 
Finally, to activate an automatic reminder via email, add the following entries to crontab(5). The following will give me warning of events 7 days in advance:
@reboot /usr/bin/calendar -A 7 | mail -e -s "Reminders from Calendar" name@localhost
@daily /usr/bin/calendar -A 7 | mail -e -s "Reminders from Calendar" name@localhost
That is all there is too it!  Enjoy!  Please let me know if you have any suggestions or corrections.

No comments: