目录
获取容器id
#!/usr/bin/env bash
now=$(date +%s)
dockerids=$(docker ps | grep xx-pod | grep yy-container | awk '{print $1}')
for item in ${dockerids[@]}
do
echo "dockerid: ${item}"
echo "dockerid: ${item}" >>> ${now}_result.txt
docker exec ${item} bash -c "ps -elL | grep zzz-proc | awk '{print \$6}' | xargs -I {} taskset -pc {} " >>> ${now}_result.txt
done
标签:容器,grep,检查,echo,item,result,进程,now
From: https://www.cnblogs.com/aaron2932/p/16633035.html