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:
41,518
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

ekodjogqn
Guest

Re: Problem with GET using both -latest and filemask

Hi, i have been facing the same issue for a while now.
Below is the syntax i'm using and i'm running it on WinSCP-5.18.2
get - latest /var/ftp/ARCHIVE/ACCOUNT_HOLDER/*.csv C:\Users\ekodjogan\Downloads\
But it is not working

Reply with quote

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

Re: Problem with GET using both -latest and filemask

There should be no space between the - and the latest:
get -latest /var/ftp/ARCHIVE/ACCOUNT_HOLDER/*.csv C:\Users\ekodjogan\Downloads\

Reply with quote

Advertisement

You can post new topics in this forum