Link to home
Start Free TrialLog in
Avatar of Gary Antonellis
Gary AntonellisFlag for United States of America

asked on

CRON expression that fires every other Tuesday

I need a CRON expression that fires every other Tuesday at 2AM.  It is used to run a payroll process and the pay periods are 2weeks long.

There is no relationship to certain Tuesdays of the month, it simply must fire one Tuesday then skip the next.  If possible it would be nice to specify an 'anchor' date.

Thanks!
Avatar of mattjp88
mattjp88
Flag of United States of America image

My recommendation would be to wrap your script in bash or python or similar and perform your logic there.  Have your cron fire that script every Tuesday and have your script logic figure out if it's been an even or odd number of weeks since your "anchor date"
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary Antonellis

ASKER

This looks clever, cant wait to try it out!

THanks!