Ask the Expert

A trick for scheduling cron fortnightly?

Further to your answer about scheduling cron fortnightly, I saw this under the minutes entry of a crontab file: "*/5". I took it to mean any minute divided by five equals every five minutes. Therefore, if you put "*/2" under week, you'd get every fortnight. Is this right or wrong?

Requires Free Membership to View

Alas, no. Type 'man 5 crontab' for the gory details, but in summary, no mathematics is possible. The /2 means "every second occasion specified before the slash". In your case, * for minutes means the full range of minutes: 0-59. Therefore /2 means every second minute. For weeks, crontab doesn't support ranges (eg 0-52), so use of a / is meaningless.

This was first published in June 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: