"Missing parameter for command 'get'" 使用 WinSCP 下载日期范围内的文件时

"Missing parameter for command 'get'" when downloading files within date range using WinSCP

我正在使用以下命令从 FTP 下载文件,但出现错误

    "get -filemask="*>=2018-12-01" -preservetime -resume -speed=5000 /ECC/PITR/WAL_ARCHIVE E:\ECC\PITR\WAL_ARCHIVE\" ^
    "exit"

错误:

> 2020-12-17 12:46:50.392 Script: get -filemask=*
< 2020-12-17 12:46:50.392 Script: Missing parameter for command 'get'.

调用get之前连接是否打开?

https://winscp.net/forum/viewtopic.php?t=11089

..."脚本:命令 'get' 缺少参数。"...

马丁:

winscp.exe /console /command "option batch abort" "open root:password@192.168.1.11/private/var/root/folder1/" "get file1 c:\Users\me\Desktop\folder2"

你的引号有误。

或者double the inner quotes:

    "get -filemask=""*>=2018-12-01"" -preservetime -resume -speed=5000 /ECC/PITR/WAL_ARCHIVE E:\ECC\PITR\WAL_ARCHIVE\" ^

或者由于文件掩码周围的引号是多余的,因为掩码中没有 space,您可以将它们完全删除:

    "get -filemask=*>=2018-12-01 -preservetime -resume -speed=5000 /ECC/PITR/WAL_ARCHIVE E:\ECC\PITR\WAL_ARCHIVE\" ^

另见 Why are some WinSCP scripting commands specified in a batch file not executed/failing?


如果您想避免下载不包含任何相关文件的文件夹,请参阅