Files
tc_ShellScripts_big_file/monitorMemory_while.sh
2023-07-04 22:08:17 +08:00

18 lines
333 B
Bash
Executable File

#!/bin/bash
while true
do
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"\t"$Mem
echo -e $txt &>> /media/nvme/300TC/programRunLog/memoryUseage.txt
sleep 2
done