-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
721 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## Start workflow | ||
00 03 * * * chmod +x workflow.sh && nohup /home/omnilab/OmniDataHouse/workflow.sh |
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
function clean_trash () { | ||
hadoop fs -rm -r .Trash/Current > /dev/null | ||
} | ||
|
||
function die () { | ||
echo "${@}" | ||
exit 1 | ||
} | ||
|
||
# Check permission | ||
if [ `whoami` != 'omnilab' ]; then | ||
die "Need permission of OMNILAB to run. Try user omnilab." | ||
fi | ||
|
||
# Global vars | ||
BASEDIR=$(dirname $0)/.. | ||
source $BASEDIR/global_config.sh | ||
|
||
for rawfile in `ls $WIFI_SYSLOG_PATH`; do | ||
rfname=${rawfile%.*} | ||
year=`echo $rfname | cut -d "-" -f1 | sed -e 's/wifilog\([0-9]*\)/\1/g'` | ||
month=`echo $rfname | cut -d "-" -f2` | ||
day=`echo $rfname | cut -d "-" -f3` | ||
if ! hadoop fs -test -e $HDFS_WIFI_SYSLOG/$rfname/_SUCCESS; then | ||
echo `printf "%4d-%02d-%02d" $year $month $day` | ||
fi | ||
done | ||
|
||
exit 0; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# Check the dates without successful processing | ||
|
||
function clean_trash () { | ||
hadoop fs -rm -r .Trash/Current > /dev/null | ||
} | ||
|
||
function die () { | ||
echo "${@}" | ||
exit 1 | ||
} | ||
|
||
# Check permission | ||
if [ `whoami` != 'omnilab' ]; then | ||
die "Need permission of OMNILAB to run. Try user omnilab." | ||
fi | ||
|
||
# Global vars | ||
BASEDIR=$(dirname $0)/.. | ||
source $BASEDIR/global_config.sh | ||
|
||
for rawfile in `ls $WIFI_SYSLOG_PATH`; do | ||
rfname=${rawfile%.*} | ||
year=`echo $rfname | cut -d "-" -f1 | sed -e 's/wifilog\([0-9]*\)/\1/g'` | ||
month=`echo $rfname | cut -d "-" -f2` | ||
day=`echo $rfname | cut -d "-" -f3` | ||
if ! hadoop fs -test -e $HDFS_WIFI_SYSLOG_SESSION/$rfname/_SUCCESS; then | ||
echo `printf "%4d-%02d-%02d" $year ${month#0} ${day#0}` | ||
fi | ||
done | ||
|
||
exit 0; |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
function die () { | ||
echo "${@}" | ||
exit 1 | ||
} | ||
|
||
# Check permission | ||
if [ `whoami` != 'omnilab' ]; then | ||
die "Need permission of OMNILAB to run. Try user omnilab." | ||
fi | ||
|
||
# Global vars | ||
BASEDIR=$(dirname $0)/.. | ||
source $BASEDIR/global_config.sh | ||
|
||
# Check root path for raw data | ||
if [ ! -d $WIFI_TRAFFIC_PATH ]; then | ||
die "Cann't find path for archived traffic data: $WIFI_TRAFFIC_PATH" | ||
fi | ||
|
||
year=`date -d "yesterday" "+%Y"` | ||
month=`date -d "yesterday" "+%b"` | ||
month2=`date -d "yesterday" "+%m"` | ||
day=`date -d "yesterday" "+%d"` | ||
|
||
INPUT_PATH=$WIFI_TRAFFIC_PATH/$year$month/tcp/*_$day_$month_$year.out | ||
|
||
OUTPUT_TCP=$HDFS_WIFI_TRAFFIC/TCP/$year$month2$day | ||
OUTPUT_TCP_NOCOMPLETE=$HDFS_WIFI_TRAFFIC/TCP_NOCOMPLETE/$year$month2$day | ||
OUTPUT_UDP=$HDFS_WIFI_TRAFFIC/UDP/$year$month2$day | ||
|
||
# Decompress files WITHOUT further processing | ||
for file in `ls $INPUT_PATH`; do | ||
echo $file | ||
rfname=${file%.*} | ||
|
||
if ! hadoop fs -test -e $INPUT_TEMP/`basename $rfname`; then | ||
gunzip -c $file | hadoop fs -put - $INPUT_TEMP/`basename $rfname` | ||
fi | ||
done | ||
|
||
clean_trash | ||
|
||
exit 0; |
Oops, something went wrong.