not print tftp log. verify fileSize is 1MB.
This commit is contained in:
parent
c7bb0b9df9
commit
10fa77f3f3
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# clean data and filter some to rediect to new file
|
# clean data and filter some to rediect to new file
|
||||||
# env: rlx linux with origin-awk
|
# env: rlx linux with origin-awk and /bin/sh
|
||||||
# Author: Liao
|
# Author: Liao
|
||||||
# modify time: 2022/2/18 16:05 (+8:00)
|
# modify time: 2022/2/18 16:05 (+8:00)
|
||||||
#############################
|
#############################
|
||||||
|
|
||||||
BEGIN{
|
BEGIN{
|
||||||
fileSize = 1024*1
|
fileSize = 1024*1024*1
|
||||||
uploadCount = 0
|
uploadCount = 0
|
||||||
|
|
||||||
# filePath = "/data/log_dir/mySimpleLog"
|
# filePath = "/data/log_dir/mySimpleLog"
|
||||||
|
@ -80,11 +80,15 @@ function checkFileSize(){
|
||||||
function splitAndUpload(){
|
function splitAndUpload(){
|
||||||
newFileName = "mySimpleLog_"systime()
|
newFileName = "mySimpleLog_"systime()
|
||||||
print "uploading..."
|
print "uploading..."
|
||||||
ret = system("mv /data/log_dir/mySimpleLog /data/log_dir/"newFileName" && cd /data/log_dir/ && tftp 192.168.1.5 -p -l "newFileName" && rm "newFileName)
|
ret = system("mv /data/log_dir/mySimpleLog /data/log_dir/"newFileName" && cd /data/log_dir/ && tftp 192.168.1.5 -p -l "newFileName" > /dev/null && rm "newFileName)
|
||||||
if(!ret){
|
if(!ret){
|
||||||
print "upload success!"
|
print "upload success!"
|
||||||
uploadCount++
|
uploadCount++
|
||||||
}else{
|
}else{
|
||||||
print "upload fail!"
|
print "upload fail!"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function notify2python(){
|
||||||
|
# system("curl http://192.168.1.5/executable")
|
||||||
}
|
}
|
Loading…
Reference in New Issue