使用WinSCP从远程服务器下载名称为今天的文件 [英] Download file with today's date in its name from remote server with WinSCP

查看:41
本文介绍了使用WinSCP从远程服务器下载名称为今天的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用.bat和.txt文件下载远程目录中的每日文件

I want to use .bat and .txt files to download a daily file I have off of a remote directory

文件的根始终是相同的,但是日期会更改...每天

The root of the file is always the same, but the date changes...daily

get filename_yyyymmdd.txt

如何搜索和下载具有今天日期的文件?

How can I search and download the file with today's date?

谢谢

推荐答案

如果可以依靠文件时间戳,请使用

If you can rely on file timestamp, use file mask with time-constaint.

请参见基于WinSCP时间的文件下载.

如果必须依赖文件名,请使用 %TIMESTAMP%语法:

If you have to rely on a file name, use the %TIMESTAMP% syntax:

get filename_%TIMESTAMP#yyyymmdd%.txt


还考虑使用 WinSCP .NET程序集,而不是使用脚本.特别是,如果您知道,例如PowerShell.


Also consider using WinSCP .NET assembly, instead of scripting. Particularly, if you know, say, PowerShell.

这篇关于使用WinSCP从远程服务器下载名称为今天的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆