多客户端ftp下载脚本

#!/bin/sh

case $# in 1)

FILENAME="$1"
HOSTNAME="220.194.55.229 220.194.55.230 220.194.55.231 220.194.55.232 218.109.12.132 218.109.12.134 218.109.12.135 218.109.12.140"
LOCALDIR=/usr/local/apache/htdocs/down
REMOTDIR=/usr/local/webhome/magazine/magnew
echo > /var/log/buddyauto.log
if test -r $LOCALDIR/$1;then
for i in $HOSTNAME
do
echo "open $i
user  ftp  *****
binary
cd $REMOTDIR
lcd $LOCALDIR
put $FILENAME
bye
" | ftp -n >>/var/log/buddyauto.log
echo `date`"##############HostName=$i###########" >> /var/log/buddyauto.log

done
else
echo "error Magazine Name"
exit 0
fi

;;

*)
echo "Usage: $0 <Please Input Magazine Name>"
      ;;
esac

 

你可能感兴趣的:(客户端,admin,LCD,ftp下载,Magazine)