Gary Thornock wrote:
That would work OK for week of the month, but what I need in this
case is "every other week", regardless of where it falls in the
month.  The crontab entry I originally posted appears, after a
minimal amount of testing, to do what I want for December 2004,
but I'm not sure it will work in other months.

I ended up, against my preference (*), writing a script using
Date::Calc which will work for the rest of 2004 (where I need
even weeks) and 2005 (which, as it turns out, needs odd weeks,
because 2004 has 53 weeks the way Date::Calc figures things).
I'll have to add another condition to the script sometime in the
next year to handle 2006.

A more general solution to this (every-other-*) is to set cron to fire every week and have a simple script like this:


#!/bin/bash
if [ -f /tmp/not_this_time ]
then
 echo "Not running this time"
 rm /tmp/not_this_time
else
 echo "Running this time"
 touch /tmp/not_this_time
fi

This will alternate between running and not running, and should give you the desired functionality.

Frank
---------------------------------------------------------------------------
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
[EMAIL PROTECTED]

--------------------
BYU Unix Users Group http://uug.byu.edu/


The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to