Create cpu_usage.sh

This commit is contained in:
midoks
2023-02-05 12:25:57 +08:00
parent 8b108d1aff
commit f491641ab8
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
DST_DIR=/www/server/op_waf
DIS_FILE=${DST_DIR}/cpu.info
CPU_USAGE=`top -bn 1 | fgrep 'Cpu(s)' | awk '{print 100 -$8}' | awk -F . '{print $1}'`
echo $CPU_USAGE > $DIS_FILE