How do I schedule a cron job fortnightly?

How do I schedule a cron job fortnightly?
A frustrating little problem. Set up cron so that it runs a script on the required day of every week, rather than on that day every second week. Inside the script put an 'if' statement. Calculate the current day as a number of days since any fixed time in the past, perhaps using date(1) for a bash/ksh/sh script. If the number of days is even, run your fortnightly job. If the number of days is odd, finish without running anything.
This was first published in May 2004

Dig deeper on Linux management and configuration

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: