shell的sftp和ftp

来源:互联网 发布:爱仕达陶瓷不粘锅知乎 编辑:程序博客网 时间:2024/05/29 03:54

 warning: here-document at line 14 delimited by end-of-file (wanted `EOF')

在EOF前不要有换行、制表符或者空格


#列出需要上传的文件

sftpfilelist=`ls $sftp_localpath/*$currentDay*`
for f in $sftpfilelist
do
echo $f
#发送文件 (关键部分)
lftp -u ${sftp_user},${sftp_passwd} sftp://${sftp_ip} <<EOF
cd ${sftp_remotepath}/
lcd ${sftp_localpath}
rm ${f}
put ${f} 
bye
EOF

done


cd ${DIR} ; 
FILES=`ls`
for FILE in ${FILES}
do
    echo ${FILE}
#发送文件(关键)   
ftp -niv <<- EOF  
open ${IP}  
user ${USER} ${PASSWORD}  
cd ${DESDIR}/
put ${FILE} 
bye  
EOF


done

0 0
原创粉丝点击