修复,无目标文件时检测会上传
This commit is contained in:
parent
ebea1ced99
commit
89709b0ac1
|
@ -8,7 +8,7 @@
|
||||||
#############################
|
#############################
|
||||||
|
|
||||||
BEGIN{
|
BEGIN{
|
||||||
fileSize = 1024*1024*1
|
fileSize = 1024*1
|
||||||
# 上位机的局域网IP
|
# 上位机的局域网IP
|
||||||
upload_ip = "192.168.1.5"
|
upload_ip = "192.168.1.5"
|
||||||
uploadCount = 0
|
uploadCount = 0
|
||||||
|
@ -86,7 +86,8 @@ function log2file(logJson){
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkFileSize(){
|
function checkFileSize(){
|
||||||
checkState = system("ls -l /data/log_dir/mySimpleLog | awk '{ if($5 >"fileSize"){exit 0}else{exit 1} }'")
|
|
||||||
|
checkState = system("ls -l /data/log_dir/mySimpleLog | awk '$0 !~ /No such file or directory/{ if($5 >"fileSize"){exit 0}else{exit 1} }'")
|
||||||
if(!checkState){
|
if(!checkState){
|
||||||
splitAndUpload()
|
splitAndUpload()
|
||||||
}
|
}
|
||||||
|
@ -105,7 +106,7 @@ function splitAndUpload(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function doMoreLine(){
|
function getOneMoreLine(){
|
||||||
if((getline conditionLine) > 0){
|
if((getline conditionLine) > 0){
|
||||||
adps = match(conditionLine,/toggle action: \{.*\}\}/) ? substr(substr($0,RSTART,RLENGTH),16,RLENGTH-15) : "\"unkown\""
|
adps = match(conditionLine,/toggle action: \{.*\}\}/) ? substr(substr($0,RSTART,RLENGTH),16,RLENGTH-15) : "\"unkown\""
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in New Issue