Created
September 26, 2018 15:58
-
-
Save nara-l/f40a556213084c8dbda5357ce93cbb0b to your computer and use it in GitHub Desktop.
Heroku Monthly Scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# funny thing Heroku scheduler has no way of running a task monthly easily, one has to use a command like this: | |
if [ "$(date +%d)" = 01 ]; then MY_COMMAND; fi | |
# Run task every monday | |
if [ "$(date +%u)" = 1 ]; then MY_COMMAND; fi | |
# Run task every 24th of the year | |
if [ "$(date +%m)" = 12 ] && [ "$(date +%d)" = 24 ]; then MY_COMMAND; fi | |
# https://stackoverflow.com/a/41470302/851056 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment