I am a programmer, and do not know a lot about crons, but I want to know if this is possible.
Lets say I have an array [option1, option2, option3]
and a script which I run in NodeJS called script.js
. I want to run this script each day at 1 am. The cron
command of this would be:
0 1 * * * node ~/script.js
Well now the tricky part, I want to rotate the options each day, so for example monday I want to run node ~/script.js option1
, the next day node ~/script.js option2
and so on. Also, I want to be able to add/remove options when needed, but the rotation should stay intact.
Is this possible in any way? I know I could do this within node also, but I'd rather do this from outside the script, and leave the script as it is.