I need to set up a weekly email that cycles between 4 variations, eg.
- variation a
- then b
- then c
- then d
- then back to a
- etc
each week.
I'd like to do this using 4 cron tasks (each of which sends an email every 4 weeks), but I'm having trouble staggering them so that each task starts on a different week, rather than having them all send their emails on the first week then having nothing for the next 4 weeks.
My crontab looks like this at the moment:
0 8 * * 1/4 echo "Variation A" | mail -s "Test email" admin@mydomain.com
0 8 * * 1/4 echo "Variation B" | mail -s "Test email" admin@mydomain.com
0 8 * * 1/4 echo "Variation C" | mail -s "Test email" admin@mydomain.com
0 8 * * 1/4 echo "Variation D" | mail -s "Test email" admin@mydomain.com
I feel a bit like if I could control when each one sends the email for the first time then I could get it working right?
Can anyone see a better way of doing this? Preferably with a minimal of scripting (I'd like to keep all of the details within the crontab)
day-of-week
, not week-of-month or whatever you were going for.