Skip to content

Instantly share code, notes, and snippets.

@jgoulah
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save jgoulah/43632bd67fbb8be326c6 to your computer and use it in GitHub Desktop.

Select an option

Save jgoulah/43632bd67fbb8be326c6 to your computer and use it in GitHub Desktop.
#!/bin/bash
function check {
when=$(date --date="$1 15:00" --utc)
echo -n "$when: "
# run design mixer every other monday starting from jan 5 2015
((($(date +%s --date="$when") + 259200) / 86400 % 14)) && echo run || echo skip
# run manager mixer every other monday starting from jan 12 2015
#((($(date +%s --date="$when") + 864000) / 86400 % 14)) && echo run || echo skip
}
for start in "2015-01-05"; do
for x in $(seq 0 24); do
check "$start + $(($x * 7)) days"
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment