#----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