-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhdfs_file_put
More file actions
26 lines (23 loc) · 965 Bytes
/
hdfs_file_put
File metadata and controls
26 lines (23 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
GZDIR=/DiskPCap/roamware2/Roamware/logs/ris/txnprocessor/out/ss7trace_vhadl_test
export GZDIR
GZLIST=`find "$GZDIR" -name '*.gz' -print`
Hour=$(date +"%H")
Minute=$(date +"%M")
for FILE in ${GZLIST}
do
RecordHour=`zcat $FILE | awk -F, '{print $1}' | head -1 | awk -F ' ' '{print $2}' | awk -F ':' '{print $1}'`
RecordMinute=`zcat $FILE | awk -F, '{print $1}' | head -1 | awk -F ' ' '{print $2}' | awk -F ':' '{print $2}'`
if [ "$Hour" -gt "$RecordHour" ]; then
hdfs dfs -put $FILE input/SS7/
elif [ "$Hour" -eq "$RecordHour" ] && [ "$Minute" -ge "$RecordMinute" ]; then
hdfs dfs -put $FILE input/SS7/
else
echo 'Rahul said, "time yet to come to put files"'
fi
echo $Hour
echo $Minute
echo $RecordHour
echo $RecordMinute
echo $FILE
done