linux 自动登录ftp 获取文件

1.ftp自动登录批量下载文件  

#####从ftp服务器上的remote_path 到 本地的local_path

#!/bin/bash

ftp -n<<!

open ip

user username password

binary

cd remote_path

lcd local_path

prompt

#单个文件用get,多个文件用mget

mget *

close

bye

!

2.ftp自动登录上传文件

####本地的local_path to ftp服务器上的remote_path
#!/bin/bash
ftp -n<<!
open ip
user username password
binary
hash
cd remote_path
lcd local_path
prompt

#单个文件用get,多个文件用mget
mput *
close
bye
!

原文地址:https://www.cnblogs.com/rookie-ray/p/11159348.html