- #!/bin/bash
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
- export PATH
- CpuInfo=70
- CpuUsed=`top -b -n1 | fgrep "Cpu(s)" | tail -1 | awk -F'id,' '{split($1, vs, ","); v=vs[length(vs)]; sub(/\s+/, "", v);sub(/\s+/, "", v); printf "%d", 100-v;}'`
- if [ $CpuInfo -le $CpuUsed ]; then
- for phpV in 56
- do
- if [ -f /www/server/php/${phpV}/bin/php ]; then
- /etc/init.d/php-fpm-${phpV} restart
- fi
- done
- fi
复制代码
这个任务对么,添加了,执行日志显示不成功
|
|