首页 > 技术文章 > shell脚本之lftp上传

leisurelyRD 2018-04-26 11:31 原文

#!/bin/bash
# Upload HW cdr to ESB by FTP
# wirter by HanBing TEL:
local=/opt/NMSAPP/business/hwbill/tarFile/
yesterday=`date -d "1 day ago" +"%Y%m%d"`

cd $local
find $local -type f -cmin +15 -exec mv {} ../backup/ \;
cd /opt/NMSAPP/business/hwbill/backup/
lftp xx.xx.xx.xx -p x -u uname,'passwd' -e 'cd /opt/esb/Downloads/esbdata/ESBcdr/;mput *.tar.gz;bye'
rm -f LN*.tar.gz

 

#!/bin/sh

ftp -n IP PORT<<EOF

user USERNAME PASSWORD

cd DIR

bin

prompt

mput FILENAMES

bye

EOF

推荐阅读