Skip to content

Instantly share code, notes, and snippets.

@spidersea
Created December 24, 2013 08:52
Show Gist options
  • Save spidersea/8110546 to your computer and use it in GitHub Desktop.
Save spidersea/8110546 to your computer and use it in GitHub Desktop.
#!/bin/bash
RSYNC_ORIGINAL_LOG (){
SET_SERVICE=$1
SEQUENCE=$2
SOURCE_IP=$3
rsync $ORIGINAL_LOG_PATH/${SOURCE_IP}/${SET_SERVICE}.log.${SET_DATE_FROMAT}.gz 10.32.231.97::snowman_original_org/${SET_SERVICE}/${SET_DATE_FROMAT//-/}/${SET_SERVICE}.log.${SET_DATE_FROMAT//-/}-${SEQUENCE}.gz
}
DIRECTION_IP_LIST=(x.x.x.x x.x.x.x x.x.x.x)
LSE_IP_LIST=(x.x.x.x x.x.x.x x.x.x.x x.x.x.x)
ORIGINAL_LOG_PATH="/log/snowman/"
for m in `seq -w 09 20`
do
SET_DATE_FROMAT="2013-10-$m"
for i in `seq -w 0 $((${#DIRECTION_IP_LIST[*]}-1))`
do
RSYNC_ORIGINAL_LOG directions $i ${DIRECTION_IP_LIST[$i]}
done
for i in `seq -w 0 $((${#LSE_IP_LIST[*]}-1))`
do
RSYNC_ORIGINAL_LOG lse $i ${LSE_IP_LIST[$i]}
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment