Created
September 26, 2014 20:01
-
-
Save katpadi/425ea20db85d141e4328 to your computer and use it in GitHub Desktop.
cron for bot
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 | |
echo `date` >> /tmp/autofaves.log | |
maxdelay=$((16*60)) # 16 hours from 2am to 11pm (in minutes) | |
for ((x=1; x<=24; x++)); do | |
# pick random delay for each of the 24 runs | |
delay=$(($RANDOM%maxdelay)) | |
# background a subshell to wait, then run | |
(sleep $((delay*60)); cd /apps/xdaysb4nba && ruby fave.rb || echo "ERROR!") & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment