利用任务自动上传备份。

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

 

posted on 2013-08-12 13:15  DieAngel  阅读(128)  评论(0)    收藏  举报

导航