Problem with GET using both -latest and filemask

Advertisement

David STCS
Joined:
Posts:
2
Location:
Stockholm, Sweden

Problem with GET using both -latest and filemask

Hi,

I have a script file based automation set up to connect to a Salesforce SFTP and my goal is to download the newest file matching a filemask in a certain folder. The script connects without problems and then tries:

get -latest -filemask=tracking_*.zip /export/* MyLocalDownloadDirectory\

The files are named with the export date, as tracking_YYYYMMDD.zip. I thought I had it working, but looking at the logs it seems to be failing sometimes, despite there being a new file matching all criteria.

When it works, the log lists files and then says 'Copying 1 files/directories to local directory...' but when it fails, there is a 'File "/export/blablabla" excluded from transfer' after the list of files, where 'blablabla' doesn't match my filemask at all, and then an '(ESkipFile)' followed by 'Copying finished: Transferred: 0'.

Is this combination of the two switches -latest and -filemask not possible or am I using the wrong syntax?

I'm running WinSCP 5.13.5 (Build 8967).

Best regards,
David

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
31,598
Location:
Prague, Czechia

Re: Problem with GET using both -latest and filemask

Indeed the -latest switch does not work with -filemask.
But for your simple requirements, this will do:
get -latest /export/tracking_*.zip MyLocalDownloadDirectory\

Reply with quote

David STCS
Joined:
Posts:
2
Location:
Stockholm, Sweden

Re: Problem with GET using both -latest and filemask

Great, thanks Martin!

/ David

martin wrote:

Indeed the -latest switch does not work with -filemask.
But for your simple requirements, this will do:
get -latest /export/tracking_*.zip MyLocalDownloadDirectory\

Reply with quote

Advertisement

You can post new topics in this forum