email birthday reminder

maik

New Member

Reaction score: 1
Messages: 11

hi folks,

i am looking for a solution to get reminders for birthdays.
Having serious issues to remind myself to the dates and friends are getting pissed off.
So I tried with the calendar app on my "battery always empty phone" but the problem is, that it is not reliable enough, there is no alert, just a small indication at 9:00 which i often miss.

So I thought an email reminder thing would be awesome.
Since I am running a server anyway, that could be easy to implement.

Is there any package around or a project known which searches for a date and send an email at this date?

appreciate your help
 

Zirias

Daemon

Reaction score: 1,041
Messages: 1,887

A simple script using date(1) and mail(1), executed daily from cron, comes to mind... e.g. you could have files named like 07-21 for July, 21st and use date -I | cut -d- -f2-3.
 

Mjölnir

Daemon

Reaction score: 1,463
Messages: 2,114

RTFM mail(1) & calendar(1), call it daily by your crontab(5) with your birthday text file (templates: /usr/share/calendar). A more sophisticated solution is to use e.g. KDE PIM suite (kde/kontact), it can remind you a week before or s/th like that. But you can do that with the simple sulution as well: insert two items, a reminder a week before and the real birthday.
 
OP
maik

maik

New Member

Reaction score: 1
Messages: 11

since i have not done any scripting, I actually hope there is already something documented for a non desktop environment.

doing freestyle like zirias mentioned would be the last option for me.
 

Mjölnir

Daemon

Reaction score: 1,463
Messages: 2,114

All the parts you need are there since decades & very well documented. You already started communication. All you need is the last three XP principles: simplicity, feedback & courage. pkg search remind pkg rdesc remind. Back to the home-grown simple solution:
calendar -A 7 -f calendar.australia shows no output, but calendar -A 7 -f calendar.german does. Thus
sh -c 'if [ -n $(calendar -A 7 -f calendar.australia) ]; then echo no; else echo yes; fi' gives "no" but in the german calendar there's a matching date so it echoes "yes". Now you have the start of your sh(1) script to call from your crontab(5).
Bash:
#!/bin/sh
#
# ~/bin/remind.sh - e-mail reminder to be called from crontab(5)
# put reminders in ~/.calendar/calendar (format like /usr/share/calendar/*)

CAL_CMD='calendar -A 7'

if [ -n "$(${CAL_CMD})" ]; then
    ${CAL_CMD} | mail -s 'automagic reminder' me@localhost
fi
 
OP
maik

maik

New Member

Reaction score: 1
Messages: 11

thanks for this, will try it out within the next days

may I ask where I can find documentation of the mentioned packages?
Tried to google it but couldn't really find something
 

kpedersen

Daemon

Reaction score: 1,545
Messages: 2,417

Code:
$ sleep 6829112 && echo "Happy Birthday kpedersen!"

Note: If you still need to actually use your computer whilst you are waiting for my birthday, then perhaps run it in tmux.
 

Mjölnir

Daemon

Reaction score: 1,463
Messages: 2,114

thanks for this, will try it out within the next days

may I ask where I can find documentation of the mentioned packages?
Tried to google it but couldn't really find something
pkg alias
Code:
ALIAS ARGUMENTS
all-depends 'query %dn-%dv'
all-rdepends 'rquery %dn-%dv'
annotations 'info -A'
build-depends 'info -qd'
cinfo 'info -Cx'
comment 'query -i "[%C/%n] %c"'
csearch 'search -Cx'
desc 'query -i "%e"'
download 'fetch'
iinfo 'info -ix'
isearch 'search -ix'
leaf 'query -e '%#r == 0' '%n-%v''
license 'query "%l: %L"'
list 'info -ql'
provides 'query "[%n-%v] %b"'
provides-all 'query -a "[%n-%v] %b"'
rprovides 'rquery "[%n-%v] %b"'
rprovides-all 'rquery -a "[%n-%v] %b"'
message 'query '[%C/%n] %M''
noauto 'query -e '%a == 0' '%n-%v''
options 'query -i "%n - %Ok: %Ov"'
origin 'info -qo'
prime-list 'query -e '%a = 0' '%n''
prime-origins 'query -e '%a = 0' '%o''
provided-depends 'info -qb'
rall-depends 'rquery %dn-%dv'
raw 'info -R'
rcomment 'rquery -i "[%C/%n] %M"'
rdesc 'rquery -i "%e"'
required-depends 'info -qr'
rinfo 'rquery -i "%c"'
rlicense 'rquery -i "%l: %L"'
rmessage 'query -i "[%C/%n-%v] %M"'
roptions 'rquery -i "%n - %Ok: %Ov"'
shared-depends 'info -qB'
show 'info -f -k'
size 'info -sq'
pkg rdesc remind
For the UNIX utilities, see any book or RTFM your systems man pages.
Standard disclaimer: install the docs: pkg install {de,en}-freebsd-doc, replace de with your native tongue, and point your favorite browser to /usr/local/share/doc/freebsd.
You can add to the alias section of /usr/local/etc/pkg.conf
Code:
  message: "query '[%C/%n] %M'",
  rmessage: query -i "[%C/%n-%v] %M",
and read through all pkg message|less.
 

Mjölnir

Daemon

Reaction score: 1,463
Messages: 2,114

since cron(8) can handle to send mail iff the cron job has any output, you can simplify the above even more: put in your crontab(5) (invoke setenv EDITOR ee; crontab -e or crontab filename)
Code:
MAILTO=me@doma.in
* 8 * * *       calendar -A 7
 
OP
maik

maik

New Member

Reaction score: 1
Messages: 11

I could not get it working, so I stopped ripping out my hair and just used nextclouds calendar

anyway, thanks for your feedback.
 

Mjölnir

Daemon

Reaction score: 1,463
Messages: 2,114

The only two reasons for such a simple (but maybe elegant) solution not to work are
  • you have no working e-mail MTA
  • typo in your ~/.calendar/calendar file
Now the cloud has even more of your personal data.
 
OP
maik

maik

New Member

Reaction score: 1
Messages: 11

The only two reasons for such a simple (but maybe elegant) solution not to work are
  • you have no working e-mail MTA
  • typo in your ~/.calendar/calendar file
Now the cloud has even more of your personal data.
appreciate your thinking, I am a fan of privacy, so I hope the self hosted Nextcloud instance is not transferring data.

anyhow my biggest issue is just that I need someone to take my hand and help me with the commands and the relation (connection) between to different applications.
I tried to read thru myself but I have issues reading stuff for hours and keep the knowledge over time.
 

hruodr

Aspiring Daemon

Reaction score: 205
Messages: 770

I call calendar in .tcsh and have template .calendar/calendar with
empty and filled entries for each day of the form:

1/3 %
1/3 %
1/3 %

1/4 %
1/4 %
1/4 %

Then, I do minimal editions to my calendar when necessary. This way I avoid errors in the file.
I will soon change the method and include a file with the filled entries that are identical each year.

Then you must pay attention after each login, after each xterm you open.
 
Top