Auto transfer files from remote server by filename

Advertisement

johnny5065
Guest

Auto transfer files from remote server by filename

Currently, I'd like to transfer file from remote server (sftp) to local virtual machine. The filename is like 'E3190130_124201372' and '190130' means the date of 2019-01-30. The aim is to download all files from last day of last month to last day of current month. local virtual machine connects to remote server via private and public key.Winscp version is 5.13.I haven't use winscp scripting before and I'd like to know if it is possible to implement this. Thank you.

Reply with quote

Advertisement

johnny5065
Joined:
Posts:
2

Now I am trying another option to transfer file from remote server to local the day before current date (yesterday file) to local directory. The remote server date format is d/MM/yyyy (e.g 6/03/2019 , 28/02/2019 ).There is error message when get file from remote server. Please refer to the attachment.

error.jpg

Reply with quote

johnny5065
Joined:
Posts:
2

file mask date format error

Hi Martin,

when use filemask="%TIMESTAMP#yyyy-mm-dd%", does it need to match the date format of remote server system format (e.g. 6/03/20019) ? Cheers.

Johnny

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: file mask date format error

johnny5065 wrote:

when use filemask="%TIMESTAMP#yyyy-mm-dd%", does it need to match the date format of remote server system format (e.g. 6/03/20019) ? Cheers.
Please read the documentation!
https://winscp.net/eng/docs/file_mask#size_time

WinSCP does not even know what date format the server uses.

Note that you are missing an operator (< or >) in your mask.

Reply with quote

Advertisement

You can post new topics in this forum