Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a job using crontab every other Monday. Is it possible?

share|improve this question

migrated from Aug 16 '10 at 18:29

This question came from our site for professional and enthusiast programmers.

Put '1/2' in the day of the week field. This will work with VixieCron and Anacron, but it won't work with the older versions of cron.

share|improve this answer

No experience here with VixieCron or Anacron; if you're using one of them, try Paul Tomblin's answer. If you're not, you could set up a shell script something like the following:

if [ -e $FLAG_FILE ]
  # Replace this comment with a call to the script you really want to run
  chmod u+w  $FLAG_FILE
  touch $FLAG_FILE
  chmod u-w $FLAG_FILE

Just make sure this is the only job that will do anything with the alternate_monday_flag_file. The chmod u+w before the rm and chmod u-w after the touch are there to help ensure that.

share|improve this answer

Might as well use (Roaring Penguin's) remind if you are going to use more than just a crontab entry.

share|improve this answer

You must log in to answer this question.