[Techtalk] Age-old cron problem

Conor Daly c.daly at met.ie
Mon Dec 10 16:33:05 UTC 2007


On Mon, Dec 10, 2007 at 06:54:44AM -0700 or thereabouts, Nicoya Helm wrote:
> 
> I think I will try this approach: via script, write a date to a file
> somewhere on the starting Sunday as a reference for a counter.  In that
> same script, put in logic to increment the date counter by one (i.e.
> day) then test to see if we have reached the max (14 days).  If we have,
> run the required Every-Other-Sunday-action, then reset counter.  Rinse
> and repeat.  This will still require a manual kick-off on the first
> Sunday, but after that should run every 14 days, i.e. every other
> Sunday.

You might consider 'date +"%U"' which gives a week (in the year) number.
You could then test if the week number is odd or even and trigger on that.
That avoids the possibility that a day could be missed pushing your script
out to run on a Monday instead of Sunday...
 
Conor
-- 
Conor Daly,                   
Met Eireann, Glasnevin Hill,  
Dublin 9, Ireland             
Ph +3531 8064276 Fax +3531 8064247

*********************************************************************************
This e-mail and any files transmitted with it are confidential and intended solely for the addressee. If you have received this email in error please notify the sender.
This e-mail message has also been scanned for the presence of computer viruses.

Ta an riomhphost seo, agus aon chomhad ata nasctha leis, faoi run agus is don te a seoladh chuige amhain e. Ma tharla go bhfuair tu an riomhphost seo tri dhearmad cuir in iul don te a sheol e led' thoil.

Ta an teachtaireacht riomhphoist seo scuabtha le bogearrai frithvireas.
********************************************************************************
NorthBridge Mail Server id e9yrhg43fncvj3974vjenw



More information about the Techtalk mailing list