#!/bin/bash
source ~/.gamerc

outputdate="20200708"

for set in 1 2 3 5 20; do
	echo GAMEDB${set} | colorize yellow black
	ssh GAMEDB${set} "xcat ~/servers*/MissionServer${set}/FamilyWar*.log.* ~/servers*/Log/202007*/MissionServer${set}/FamilyWar*.log.* | egrep ',\[GetSeasonRewardOK\]' | grep -v ',2020\/06' > /tmp/m12global_s${set}_familywar_getreward.log"
	ssh TEST "if [ ! -d ~/www/download/m12global_familywar_seasonreward_${outputdate}/getreward ]; then mkdir -p ~/www/download/m12global_familywar_seasonreward_${outputdate}/getreward; fi"
	ssh GAMEDB${set} "rsync -avz /tmp/m12global_s${set}_familywar_getreward.log TEST:~/www/download/m12global_familywar_seasonreward_${outputdate}/getreward" 
done
