[Shell script] FTP upload file

Upload the file index.jsp in the local directory /usr/local/shells/ftp to the directory /opt/naridtfiles of 10.0.0.13 through ftp.

 

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
!

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326946531&siteId=291194637