[K12OSN] OT: what do you use to schedule you schools bells

Jim Kronebusch jim at winonacotter.org
Tue Feb 19 17:56:00 UTC 2008

On Tue, 19 Feb 2008 10:02:02 -0600, Doug Simpson wrote
> I would like to see the scripts. I haven't used the sound card method yet, but 
> that sounds like an interesting thing anyway. . .
> Could be that the scripts could be used with other things as well.. .
> Doug

Well, they couldn't be much simpler.  In the /root I have 19 scripts that look like so:

crontab -u root /var/spool/cron/root.regular

The end of the second line is changed for every schedule, so the regular schedule has
root.regular as seen above.  An aday schedule has root.aday, bday is root.bday, and so on.  

Then in /var/spool/cron I have all of the crontabs named root.regular, root.aday,
root.bday and so on.  The contents of those files look like this:

# Cron Syntax
# Minute range: 0-59, Hour range: 0-23, Day of the Month range: 1-31, Month of the Year
# Day of the Week range:1-7 (where 1 is Monday)

# Regular Schedule

45 8 * * 1-5 /root/schedule/regular
50 8 * * 1-5 play /root/bell.wav
35 9 * * 1-5 play /root/bell.wav
40 9 * * 1-5 play /root/bell.wav
25 10 * * 1-5 play /root/bell.wav
30 10 * * 1-5 play /root/bell.wav
15 11 * * 1-5 play /root/bell.wav
20 11 * * 1-5 play /root/bell.wav
50 11 * * 1-5 play /root/bell.wav
55 11 * * 1-5 play /root/bell.wav
05 12 * * 1-5 play /root/bell.wav
10 12 * * 1-5 play /root/bell.wav
40 12 * * 1-5 play /root/bell.wav
45 12 * * 1-5 play /root/bell.wav
55 12 * * 1-5 play /root/bell.wav
00 13 * * 1-5 play /root/bell.wav
45 13 * * 1-5 play /root/bell.wav
50 13 * * 1-5 play /root/bell.wav
35 14 * * 1-5 play /root/bell.wav
40 14 * * 1-5 play /root/bell.wav
25 15 * * 1-5 play /root/bell.wav

Each file has the name of the schedule commented out so to keep track if I ever have to
modify them.  The first line of the cron plays my voice file, which simply plays 5
minutes before the first class starts saying "Today, we'll be following a regular
schedule." In /root/schedule I have all the recordings for every schedule.  The standard
chime is in /root and called bell.wav.  This is simply played at the beginning and end
of each class period, and for lunch periods.  

So at the end of each month everyone is given a bell schedule for the next month.  Then
I simply log onto webmin and click the "Scheduled Commands" module.  Then enter a new
command for each day the schedule changes.  I enter the "Run as User" as root, the date
to run and the time to run (usually 45 minutes before school starts), the directory to
run in as /root, and the command to run (ie: ./regular, ./aday, ./bday, etc).  

Then on the day the command is scheduled for, the script runs that simply swaps the
correct crontab in, and it is all automatic.  Rather crude, but very simple.  I do have
a root.temp and a /root/temp available to modify for special events.  During the summer
if there are any schedule changes I simply update the bell.wav chime intervals in the
root.schedule files.

I'm sure there is a simple way to fine tune this process, or even write a simply webpage
or Gui to modify things and bypass webmin.  But I've used this for 3 years now and
haven't had the drive to improve upon this.  I run 2 servers as well, one for the Sr.
High, and one for the Jr. High.  Both schools have their own PA system so I run two as
they are both on different schedules.  It is very cool to set these a month ahead of
time and forget them.  Our old system I had to remember to set every morning (you can
imagine the problems with that, especially on Mondays).

Hope this helps someone.  And if anyone improves it, please let me know.


This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.

More information about the K12OSN mailing list