分类:
2007-09-27 13:51:42
#!/sbin/sh logfile=/etc/chk/log/`date +%Y%m%d`.run.log if [ -f "$logfile" ]; then rm $logfile fi touch $logfile tail -f $logfile & for i in `cat /etc/chk/hosts.run.lst` do (sleep 10;echo "ps -ef | grep run |wc -l";sleep 3;echo exit;) | rlogin $i >/etc/chk/run.tmp tail -n 3 /etc/chk/run.tmp >> $logfile done rm /etc/chk/run.tmp kill `ps -f -u root | grep "tail -f $logfile" | awk '{print $2}'` >/dev/null exit |