July 14, 2011

Vixie Cron How I Loath Thee.....

As some know, I work as the senior systems administrator for a company in the southeast SF Bay Area. Recently, we had to move to a new security system, after having been broken into four times in the last _four_ years.

One of the features of this new system is that it ties into our phone system to alert the building that the alarm is about to be armed. To do this, a dial out to a special phone number needs to occur at the desired hour and then voila! Instant Alert throughout our suite! So, we've setup an email to fax service that we can easily trigger by a simple email.

So I wrote a REALLY simple shell script shown below (with the fax and email addresses elided):


#!/bin/bash

set -e

echo "Sending Security Page NOW!"

/usr/sbin/sendmail -t <<EOF
FROM: SOMERANDOMSMUCK@minervanetworks.com
TO: 1234567890@fax.com
CC: SOMERANDOMSMUCK@minervanetworks.com
SUBJECT: Alarm Set

Set.

EOF

RET=$?
if [ $? -eq 0 ]; then
echo "SUCCESS"
fi



As I said, simple.

From there I setup my crontab on one of the Linux box in my cube to have it go off at the apropriote time, 7:55PM Monday through Friday:


MAILTO=SOMERANDOMSMUCK@minervanetworks.com

50 19 * * 1-5 /usr/bin/securityfax.sh


Tested out the script, thinking that "Hey, I'm all done". Wrong.

I come to find out that Vixie Cron can't seem to tell time! I get the alert emails at 8:31PM from the system!

At this point, looks like I'll be replacing Vixie Cron on my workstation (CentOS 5). Can anyone advise a good Cron Daemon replacement that has enough similarities to vixie cron that I won't have to relearn too much and can actually interpret time settings in the crontab as more than mere suggestions?