【Shell脚本】ftp上传文件

将本地目录/usr/local/shells/ftp下的文件index.jsp通过ftp上传到10.0.0.13的目录/opt/naridtfiles下。

uploadfile.sh

#!/bin/bash

# upload loacal file(/usr/local/shells/ftp/index.jsp) to server by ftp

ftp -n <<!
open 10.0.0.13
user root techstar
binary
hash
cd /opt/naridtfiles
lcd /usr/local/shells/ftp
prompt
mput index.jsp index.jsp
close
bye
!