Chinaunix

标题: 关于RSH的问题,晕了 [打印本页]

作者: huachong    时间: 2005-10-20 16:18
标题: 关于RSH的问题,晕了
#! /bin/bash

#----this is for compute users' stay (from login to logout)in cluster #----by telnet
#----
#----Oct 20

month=$(date +%-m)
let "month=$month-1"
#echo $month
year=$(date +%Y)
for cn in mgmt2 mgmt1(两个管理节点)
do
rsh $cn
for user in $(cat ./users)
do
ac $user -f /var/log/wtmp.1 | awk '{print "'$month' '$year'","'$cn'","\ttotal:"$2}' >> $user.txt
done
done

为什么只能得到一个管理节点的WTMP文件呢?
运行侯,发现都是取了mgmt1下面的/var/log/wtmp.1文件!
如何才能取到mgmt2下面的/var/log/wtmp.1文件呢?

谢谢了!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2