Created
December 24, 2013 08:52
-
-
Save spidersea/8110544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROCESS_IP(){ | |
SET_SERVICE=$1 | |
SET_DATE_FAMATE=$2 | |
SERVICE_ARRAY=($(find $SORCE_DIR -type f|grep $SET_SERVICE|grep $SET_DATE_FAMATE|sort|xargs)) | |
for i in `seq 0 $((${#SERVICE_ARRAY[*]}-1))` | |
do | |
echo ${SERVICE_ARRAY[$i]} | |
gunzip ${SERVICE_ARRAY[$i]} | |
sed -i 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$//g' ${SERVICE_ARRAY[$i]%%.gz} | |
gzip ${SERVICE_ARRAY[$i]%%.gz} | |
mv ${SERVICE_ARRAY[$i]} ${TARGET_DIR}/${SET_SERVICE}/${SET_DATE_FAMATE}/ | |
done | |
} | |
SORCE_DIR="/opt/data/snowman_original_org/" | |
TARGET_DIR="/opt/data/snowman_log" | |
#PROCESS_IP directions 20131009 | |
PROCESS_IP lse 20131010 | |
PROCESS_IP lse 20131011 | |
PROCESS_IP lse 20131012 | |
PROCESS_IP lse 20131013 | |
PROCESS_IP lse 20131014 | |
PROCESS_IP lse 20131015 | |
PROCESS_IP lse 20131016 | |
PROCESS_IP lse 20131017 | |
PROCESS_IP lse 20131018 | |
PROCESS_IP lse 20131019 | |
PROCESS_IP lse 20131020 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment