ftplinuxshell脚本
发布时间: 2025-05-05 18:50:50
1、连接上相应的linux主机,进入到等待输入shell指令的闹差linux命令行状态下。
㈡ linux shell脚本的循环下载
#!/bin/bash
#usage:getfileFirstDayLastDay
curday=$2
firstday=$1
while[$firstday-le$curday]
do
echo$curday
lftpusername:[email protected]<<EOF
lcd/ftp_folder
binary
getFile_$curday.csv-oFile_$curday.csv
close
bye
EOF
curday=`date-d"$curday1dayago"+%Y%m%d`
done
直接日期加1的根本没考虑日期跨月的情况
㈢ linux下怎样登录ftp服务器
1、首先,连接相应linux主机,进入到linux命令行状态下,等待输入shell指令。
㈣ ftp命令放入shell不识别lcd命令
ftp在shell中必须使用这种格式,用重定向把ftp命令传给ftp:
#!/bin/bash
LANG=en_US
export LANG
cd /tmp/b
ftp -nv 192.168.0.104 << EOF
user senlin senlin
cd /senlin/upload
type binary
put a.txt
quit
EOF
另外一种办法就是使用 expect脚本 ,你到网上搜搜expect命令
㈤ 如何使2台Linux服务器通过FTP自动同步文件(用Shell脚本)
楼上正解。
热点内容