I have a business requirement to run an unorthodox crontab schedule as follows:
Everyday run a script from 1-21
Everyday but saturday, run from 21-0
So I was thinking this would work:
5 1-20 * * * /path/to/script.php
5 21-00 * * 0-5,7 /path/to/script.php
Or is there a better way?
-- Edit --
Blah this is what happens when you post before morning coffee, there is no 7 in crontab syntax as its 0-6, so the entry should be:
5 * * * 0-5 /path/to/script.php
5 1-21 * * 6 /path/to/script.php
This doesn't appear to meet your requirements as it doesn't run the script every day at 21 (it doesn't run on Saturday at 21).
Your requirement appears to simplify to everyday bar Saturday run a script at 5 minutes past the hour. On a Saturday only run from 1-21 e.g.