[ server ] [ executor ]- shell executor optimize - 1
This commit is contained in:
@@ -6,6 +6,13 @@ start_time=$(date +%s)
|
||||
current_time=$(date +%s)
|
||||
elapsed_time=$((current_time - start_time))
|
||||
|
||||
|
||||
if [[ $(ps -ef | grep -v "color" |grep -c "/octopus-agent/shell/function/load50cpu_2_hour") -gt 0 ]]; then
|
||||
log "已经存在CPU占用进程 !杀死该进程"
|
||||
kill -9 $(ps -ef | grep -v "color" |grep "/octopus-agent/shell/function/load50cpu_2_hour" | awk '{print$2}')
|
||||
fi
|
||||
|
||||
|
||||
log "开始执行CPU占用任务,占用时间为 2小时!"
|
||||
while [ $elapsed_time -lt 7200 ]
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user