Commit 88301be3 authored by 宋朋's avatar 宋朋

update

parent 8c50734f
#!/bin/bash
#SFTP配置信息
#用户名
USER=sp
#密码
PASSWORD=sp940219sp
#待上传文件根目录
SRCDIR=/root
#FTP目录
DESDIR=/home/songpeng/testfile
#IP
IP=192.168.153.100
#端口
PORT=2121
#获取文件
cd ${SRCDIR};
#目录下的所有文件
#FILES=`ls`
#修改时间在执行时间五分钟之前的xml文件
FILES=`find ${SRCDIR} -name '*.txt'`
for FILE in ${FILES}
do
echo ${FILE}
#发送文件 (关键部分)
lftp -u ${USER},${PASSWORD} sftp://${IP}:${PORT} <<EOF
cd ${DESDIR}/
lcd ${SRCDIR}
put ${FILE}
by
EOF
done
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment