日期:2014-05-16  浏览次数:20617 次

Unix 使用FTP command 上传下载文件

关于 ftp:connect:Connection refused" exception,方法是加上端口号

$ftp host port

?

?

?

##get file from server

Filename="test.txt"
HOST="10.*.*.**"

HOME=/export/home/ccls
REMOTE=/export/home/ccls_d
export HOME REMOTE

REMOTE_PATH=${REMOTE}/Scripts/CRO/IN
LOCAL_PATH=${HOME}/Scripts/CRO/Archive
CRO_INFILE_FTPLOG=${LOCAL_PATH}/CCLSGetCROScreening.log
Password="ccls_d"

ftp -n $HOST <<EOF
user ccls_d "$Password"
ascii
cd $REMOTE_PATH
lcd $LOCAL_PATH
mget MCYSFS*.txt
bye
EOF