Shell script1 Linux shell script to monitor memory usage(re-start when it over the threshold) 리눅스 쉘스크립트로 cpu 메모리 관리하기 쉘스크립트의 무궁무진한 활용성으로 매 분 메모리 체크 후 일정 threshold 조건 만족 시 현재 구동하는 파이썬 코드를 죽이고 재실행하게끔 만들었다. 코드전체 #!/bin/bash mem_threshold='500' mem_free=$(free -m | awk '{print $7}') now=$(date) # CURPID1=$(ps -ef | grep vas_status.sh | awk '{ print $2 }') CURPID2=$(ps -ef | grep vas_start.sh | awk '{ print $2 }') CURPID3=$(ps -ef | grep main_IPcamera_new.py | awk '{ print $2 }') echo "memory space remaining : $mem_.. 2022. 8. 22. 이전 1 다음