#!/bin/bash
source ~/.gamerc

outputdate="20200708"

for set in 1 2 3 4 5 6 7 8 11 14 19 20 21; do
	echo GAMEDB${set} | colorize yellow black
	ssh GAMEDB${set} "xcat ~/servers*/MissionServer${set}/FamilyWar*.log.* ~/servers*/Log/2020070[78]/MissionServer${set}/FamilyWar*.log.* | egrep ',\[SeasonReward\]' | grep -v ',2020\/06' > /tmp/m12global_s${set}_familywar_seasonreward.log"
	ssh TEST "if [ ! -d ~/www/download/m12global_familywar_seasonreward_${outputdate}/seasonreward_orig ]; then mkdir -p ~/www/download/m12global_familywar_seasonreward_${outputdate}/seasonreward_orig; fi"
	ssh GAMEDB${set} "rsync -avz /tmp/m12global_s${set}_familywar_seasonreward.log TEST:~/www/download/m12global_familywar_seasonreward_${outputdate}/seasonreward_orig/" 
done
