Free, Fast, & Simple Homemade Scheduler
Everyone who uses any of the "nix's probably has used crontab at one time or another.
It's great for setting up recurring events. But, suppose you've got an an upcoming
appointment that's just a one-time event? Until recently, I'd never used the at(1)
command, but now I do to create simple reminders for myself. It began when I got a
letter from the VA where I go for checkups. They sent me a letter letting me know I
had an upcoming doctor's appointment. I started to go to my Yahoo account to write
myself a reminder on the calendar to be emailed a day before the appointment. I got
to thinking, let me see if I can do it the "nix" way. I didn't realize at the time that it
would be automatically emailed to me when at ran the command, so I created a text
file with all the pertinent information, and then wrote a short script to be called by
the at program at the prescribed time. It looked something like this:
Contents of text file:I went ahead and ran the script manually to make sure it ran correctly. Then, to
VA Appointment - date of appointment
Time - Where
Preappointment requirements
Side note from myself
Contents of script to be run using the at program:
#!/bin/sh
#
# VA Appointment Reminder
#
cat $HOME/textfile | mail -s "`bin/hostname` VA Appointment" username
Then, run at hitting a CR or Enter after each line except the final Ctrl-D:
$ at 6am Mar 25
$HOME/scriptname
Ctrl-D
commands will be executed using /bin/ksh
job 1206158400.c at Tue Mar 25 06:00:00 2008
(those last 2 lines are the output from at. After
that, you're returned to the prompt)
$ at -lThen I started playing around with at, running simple things like
and I got:
$ 1206442800.c Tue Mar 25 06:00:00 2008
$ at 1amstill not really knowing all I was soon to find out about at. I was expecting it to
echo "Get your butt in bed, old man, it's late!"
Ctrl-D
Date: Mon, Mar 2008 01:00:00 -0500 (CDT)Now I realized I didn't need an external script or text file message for something
From: Atrun Service <username@localbox.isp.net>
To: username@localbox.isp.net
Subject: Output from "at" job
Your "at" job on localbox.isp.net
"/var/cron/atjobs/1206141180.c"
produced the following output:
Get your butt in bed, old man, it's late!
$ at 6am Mar 25So, give at a try. Read the man page, experiment, and have some fun!
echo "VA Appointment - date of appointment"
echo "Time - Where"
echo (make empty space here for separation & readability)
echo "Preappointment requirements"
echo (another empty space to separate note elements)
echo "Side notes for myself"
Ctrl-D
(I omitted the output from at here. Example is shown above)
No affiliation between this site and the OpenBSD project exists or is implied.