xshell脚本监控进程

1、 xshell.sh
#!/bin/bash
while true
do

    sleep 10;
    date;
    ps -ef |grep 'snhs';
done 

2、 xshell_wr.sh

#!/bin/bash
sh xshell.sh >>logfile 2>&1  &

3、执行 sh xshell_wr.sh

 

posted @ 2023-06-08 09:10  槑槑DE  阅读(43)  评论(0)    收藏  举报