From 81ec5ca6d7f2a2a39bb7d4d9648a26c3106f95a6 Mon Sep 17 00:00:00 2001 From: Tangchao <735056338@qq.com> Date: Tue, 4 Jul 2023 22:08:17 +0800 Subject: [PATCH] Mem>3000 stop record HSI --- monitorMemory_while.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/monitorMemory_while.sh b/monitorMemory_while.sh index 4cb1fc6..aa2cff5 100755 --- a/monitorMemory_while.sh +++ b/monitorMemory_while.sh @@ -1,11 +1,16 @@ #!/bin/bash while true do - Mem=$(free -h | grep Mem) + Mem=$(free -m | grep Mem | awk {'print $3'}) + + if [ $Mem -ge 3000 ]; then + /home/300tc/projects/udpClient/udpClient 127.0.0.1 9,0 + fi + time=$(date +%Y%m%d_%H%M%S) - txt=$time$Mem - echo $txt &>> /media/nvme/300TC/programRunLog/memoryUseage.txt + txt=$time"\t"$Mem + echo -e $txt &>> /media/nvme/300TC/programRunLog/memoryUseage.txt sleep 2 done