3 # "Divide" a crontab frequency down by the first argument on the command line,
4 # logging to the second argument, and executing the remainder.
6 if [ "X$1" = "X" -o "X$2" = "X" -o "X$3" = "X" ]; then
7 echo "Usage: $0 frequency logfile command [ arguments ]" >&2
15 if [ -f $LOGFILE ]; then
16 LASTEXEC=$(($(tail -n 1 $LOGFILE)+1))
21 if [ $LASTEXEC -ge $FREQUENCY ]; then
22 echo "$*" executed at $(date) >> $LOGFILE
26 echo $LASTEXEC >> $LOGFILE