I understand that stepping in cron (*/2) means "every two [minutes|days|hours] equivalent to 0,2,4,6…
but what would happen if I did (1-11/2) Would this do 2,4,6… or 1,3,5…?
I have two computers in a network, and I want them to alternate days that they perform a cron job (to save bandwidth and headaches). I want the first one to do work on day-of-the-month 1,3,5,… and the other to do day-of-the-month 2,4,6
The man page for crontab (5) isn’t totally clear on this but it seems to suggest that /2 means an even number, and the range merely restricts the even values are are accepted, it doesn’t change the start of the sequence. Just do it like hcw says, or run the script every day, and inside the script use an arithmetic expression involving % 2 on the day of month to select the machine.
Actually it turns out on more careful reading that this behaviour is already documented, if you look further down the man page of crontab (5), it says:
Ranges can include “steps”, so “1-9/2” is the same as “1,3,5,7,9”.
However it is specified in the EXTENSIONS section, meaning that this behaviour is not required by POSIX but is implemented by Vixie cron. So beware if you try to run this cron spec on other Unixes.