#!/bin/bash
source ~/.gamerc

fulldate=$1
date=$(echo ${fulldate} | cut -c5-)
outputdate=$(date +%Y%m%d)

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} "get_log_filter ${fulldate} now Mission FamilyWar | egrep ',\[GetSeasonRewardOK\] ' > /tmp/m12global_s${set}_familywar_getreward.log"
	ssh TEST "if [ ! -d ~/www/download/m12global_familywar_seasonreward_${outputdate}/ ]; then mkdir -p ~/www/download/m12global_familywar_seasonreward_${outputdate}/; fi"
	ssh GAMEDB${set} "rsync -avz /tmp/m12global_s${set}_familywar_getreward.log TEST:~/www/download/m12global_familywar_seasonreward_${outputdate}/" 
done
