FTP Download File By Some Order List

@Echo Off

REM -- Define File Filter, i.e. files with extension .RB
Set FindStrArgs=/E /C:".asp"

REM -- Extract Ftp Script to create List of Files
Set "FtpCommand=ls"
Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp"
REM Notepad "%temp%\%~n0.ftp"

REM -- Execute Ftp Script, collect File Names
Set "FileList="
For /F "Delims=" %%A In (‘"Ftp -v -i -A -s:"%temp%\%~n0.ftp"|Findstr %FindStrArgs%"‘) Do (
Call Set "FileList=%%FileList%% "%%A""
)

REM -- Extract Ftp Script to download files that don‘t exist in local folder
Set "FtpCommand=mget"
For %%A In (%FileList%) Do If Not Exist "%%~A" Call Set "FtpCommand=%%FtpCommand%% "%%~A""
Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp"
REM Notepad "%temp%\%~n0.ftp"

For %%A In (%FtpCommand%) Do Echo.%%A

REM -- Execute Ftp Script, download files
ftp -i -s:"%temp%\%~n0.ftp"
Del "%temp%\%~n0.ftp"
GOTO:EOF

:extractFileSection StartMark EndMark FileName -- extract a section of file that is defined by a start and end mark
:: -- [IN] StartMark - start mark, use ‘...:S‘ mark to allow variable substitution
:: -- [IN,OPT] EndMark - optional end mark, default is first empty line
:: -- [IN,OPT] FileName - optional source file, default is THIS file
:$created 20080219 :$changed 20100205 :$categories ReadFile
:$source http://www.dostips.com
SETLOCAL Disabledelayedexpansion
set "bmk=%~1"
set "emk=%~2"
set "src=%~3"
set "bExtr="
set "bSubs="
if "%src%"=="" set src=%~f0& rem if no source file then assume THIS file
for /f "tokens=1,* delims=]" %%A in (‘find /n /v "" "%src%"‘) do (
if /i "%%B"=="%emk%" set "bExtr="&set "bSubs="
if defined bExtr if defined bSubs (call echo.%%B) ELSE (echo.%%B)
if /i "%%B"=="%bmk%" set "bExtr=Y"
if /i "%%B"=="%bmk%:S" set "bExtr=Y"&set "bSubs=Y"
)
EXIT /b

[Ftp Script 1]:S
!Title Connecting...
open 12.130.50.110

!Title Preparing...
cd /
lcd D:\Root
binary
hash

!Title Processing... %FtpCommand%
%FtpCommand%

!Title Disconnecting...
disconnect
bye

时间: 2024-11-06 11:41:51

FTP Download File By Some Order List的相关文章

FTP(File Transfer Protocol)是什么?

文件传输协议 FTP(File Transfer Protocol),是文件传输协议的简称.用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(Application).用户可以通过它把自己的PC机与世界各地所有运行FTP协议的服务器相连,访问服务器上的大量程序和信息.[编辑本段]FTP的作用 正如其名所示:FTP的主要作用,就是让用户连接上一个远程计算机(这些计算机上运行着FTP服务器程序)察看远程计算机有哪些文件,然后把文件从远程计算机上拷到本地计算机,或把本地计算机的文件

Bind Mounts and File System Mount Order

     When you use the bind option of the mount command, you must be sure that the file systems are mounted in the correct order. In the following example, the /var/log directory must be mounted before executing the bind mount on the /tmp directory: #

Ftp download

1. Ftp download sample (Python 2.7.9): import urllib urllib.urlretrieve('ftp://192.168.1.200/IDB%20Bond%20Release/%B2%E2%CA%D4%BB%B7%BE%B3/IDB%20Bond%201.0.3%20Patch2.rar',"Patch2.rar")

Camel FTP error:File operation failed: 150 Here comes the directory listing

问题:写了一个Camel的FTP传输程序,在本地Win7和Ubuntu下运行都正常,但是在Redhat中报"File operation failed: 150 Here comes the directory listing"异常 解决方法: 首先贴出修改前的代码以及错误,如下: 代码: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.s

[PHP学习教程]004.下载/采集远程文件到本地(Download File)

引言:如何把http://mzitu.com里的图片全部下载下来呢? 一身浩然正气的AC陷入的深思.... 当然这里涉及到的功能有线程,网页请求,页面提取,下载图片等等.今天,我们先讲一下如何下载文件.后面的教程请参看本博客的[PHP自动化-进阶]系列. 函数接口: array download_file ( [string url], [string fileName], [string dirName], [array fileType], [string type]) 方法声明: 下载任何

download file

jQuery.download = function (url, method, p, c, e, i, o, goodsType, reciveUser, suplier) { jQuery('<form action="' + url + '" method="' + (method || 'post') + '">' + '<input type="text" name="orderNo" value=

sqoop:Failed to download file from http://hdp01:8080/resources//oracle-jdbc-driver.jar due to HTTP error: HTTP Error 404: Not Found

环境:ambari2.3,centos7,sqoop1.4.6 问题描述:通过ambari安装了sqoop,又添加了oracle驱动配置,如下: 保存配置后,重启sqoop报错:http://hdp01:8080/resources//oracle-jdbc-driver.jar due to HTTP error: HTTP Error 404: Not Found 解决办法: 上传oracle驱动ojdbc6.jar到hdp01的 /var/lib/ambari-server/resourc

curl Command Download File

参考: http://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/curl -o ~/Desktop/outputfile.zip http://7xr5hw.com2.z0.glb.qiniucdn.com/mobile_h5_android_all_2.0.0.zip

FTP 文件操场 FTPClient

工作中需要实现对远程FTP文件的各种操作,简单写了个静态FTP操作工具类,以下源码供大家参考: public class FtpUtil { private static FTPClient ftpClient = new FTPClient(); private static String encoding = System.getProperty("file.encoding"); private static String defaultPath; /** * FTP初始化连接