Просмотр исходного кода

chore: 添加监控打开文件脚本

weijianghai 2 лет назад
Родитель
Сommit
feeb39d035
2 измененных файлов с 12 добавлено и 0 удалено
  1. 5 0
      build-dir/stopWatch.sh
  2. 7 0
      build-dir/watchPm5gOpenFile.sh

+ 5 - 0
build-dir/stopWatch.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+for i in $(pgrep -f watchPm5gOpenFile.sh); do
+  kill -9 "$i"
+done

+ 7 - 0
build-dir/watchPm5gOpenFile.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# 监控pm5g打开文件
+while true; do
+  sleep 1
+  date +'%Y-%m-%d %H:%M:%S' >>watch.log && lsof -p "$(pgrep -f pmInterface5g.jar)" | wc -l >>watch.log
+done &