Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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\
ekodjogqn

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
David STCS

Re: Problem with GET using both -latest and filemask

Great, thanks Martin!

/ David
martin

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\
David STCS

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