linux 执行远程命令

阅读 64

2023-04-12


#!/bin/bash

base=/home/mc
ps aux | grep message | grep -v grep | awk '{print $2}' | xargs kill -9
echo "mc stop!"

#停止slaves
cat $base/config/slaves | while read line
do

ssh root@$line  > /dev/null 2>&1  << beginremote
ps aux | grep person | grep -v grep | awk '{print $2}' | xargs kill -9     
beginremote
echo "$line pr stop!"
done


精彩评论(0)

0 0 举报