Created
December 14, 2016 15:40
-
-
Save TUNER88/4afa389ec6fff64f7b2388ecda87c3ce to your computer and use it in GitHub Desktop.
Workaround to bypass limitations of cron command frequency (some hosters allow to trigger cron jobs only each 15 or 30 minutes)
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
#!/bin/bash | |
COMMANDS[0]="php current/artisan schedule:run" | |
COMMANDS[1]="php current/artisan queue:work --tries=3" | |
ITERATIONS=30 # how often should be the commands repeated | |
INTERVAL=60 # how should the pause between iterations (in seconds) | |
for ((i=1; i<=$ITERATIONS; i++)); do | |
for COMMAND in "${COMMANDS[@]}"; do | |
$COMMAND >> /dev/null 2>&1 & | |
done | |
sleep $INTERVAL | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment