Skip to content

Instantly share code, notes, and snippets.

@katpadi
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katpadi/b4fa41d088e97cf861a6 to your computer and use it in GitHub Desktop.
Save katpadi/b4fa41d088e97cf861a6 to your computer and use it in GitHub Desktop.
#!/bin/bash
maxdelay=$((16*60)) # 16 hours from 2am to 11pm, converted to 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