#!/bin/bash rq=`date +%F%H%M` ct=`netstat -an | grep xxxxx | wc` localip=`/sbin/ifconfig eth0 | awk ‘/inet/{print $2; exit }’ | cut -d: -f2` echo “$rq $ct” >> /home/tool/tmp.txt /usr/bin/tac /home/tool/tmp.txt > $localip.txt ftp -v -n 1.1.1.1 << EOF user tlbb tlbb binary hash lcd /home/tool put $localip.txt close bye EOF