shell脚本实现ftp批量上传
- 作者: 就是看到搞笑图片就想和你们分享
- 来源: 51数据库
- 2022-08-17
#!/bin/sh
hostIP=′10.2.110.110′
serverName=′ftp_110′
password=′123456′
dirName=`pwd|sed 's/\//_/g'|cut -c2-`
if [ $1 = ′all' ];then
ftp -i -n $hostIP <<EOF_FTP
user ${serverName} ${password}
mkdir $fileName
cd $fileName
mput *
quit
EOF_FTP
else
ftp -i -n $hostIP <<EOF_FTP1
user ${serverName} ${password}
put $1
quit
EOF_FTP1
fi
推荐阅读
