although crontab is able to schedule intervals (i.e. */2 * * * * for every 2 minutes), it is not able to schedule every 3 weeks. the solution is to add some calculations (using day of year and modulo) to the script itself:


# this script will execute a command every n weeks
# usage: it should be started using cron or runwhen once a week
# found at:

# set interval (in weeks)

# get week of year
WEEK=$(/bin/date +%V)

# run command if WEEK is divisible by INTERVAL
if [ $(( $WEEK % $INTERVAL )) -eq 0 ]; then
    # WEEK is divisible by INTERVAL

    # execute command ...
    echo $WEEK

yes, you'll say: that does not work properly at the turn of a year--but maybe this is okay in your use case.

main picture from tumblr