Skip to content

Instantly share code, notes, and snippets.

@codersofthedark
Last active December 15, 2015 16:59
Show Gist options
  • Save codersofthedark/5292967 to your computer and use it in GitHub Desktop.
Save codersofthedark/5292967 to your computer and use it in GitHub Desktop.
Start two instance of tornado server
t=$(date +%s)
s=3600
t=$(expr $t - $s)
filename="analytics.log."$(date -d @$t +%Y-%m-%d_%H)
echo $filename
networkfilename=$(date +%Y%m%d%H)-$(hostname).log
echo $networkfilename
python mtornado.py &
sleep 3900
while true; do
scp -i ~/.ssh/key.pem logs/$filename ubuntu@ec2-54-224-16-67.compute-1.amazonaws.com:logs/$networkfilename
sleep 3600
t=$(date +%s)
s=3600
t=$(expr $t - $s)
filename="analytics.log."$(date -d @$t +%Y-%m-%d_%H)
networkfilename=$(date +%Y%m%d%H)-$(hostname).log
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment