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

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.