Post a reply

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)


Topic review


You still have to specify the source argument for the get command.
You can use *:
get -filemask=*.txt>yesterday *
Or in this simple case, you do not need to use -filemask switch at all:
get *.txt>yesterday

Though your attempt *30082019*.txt makes me curios what you actually want. Do you want to select files by their modification timestamp? That's what >yesterday does. Or by a timestamps contained in their filenames? What *30082019*.txt does.


Thank you for the reply.

I replaced the line I had with what you suggested and am getting the error "Missing parameter for command 'get'."
Here's the script I'm trying to use:
"C:\Program Files (x86)\WinSCP\" ^

  /log=""D:\XXXXX\WinSCP.log"" /ini=nul ^
  /command ^
    "open sftp://username:password@XXX.XXX.XXX.XXX/ -hostkey=""ssh-rsa 2048 XXXXXXXXXXX""" ^
    "cd /XXXX/XXXX/" ^
    "lcd D:\XXXX" ^
   "get -filemask=*.txt>1DS" ^
   rem "get -filemask=*.txt>yesterday" ^

I have tried with the line rem'd out too and got the same error. This all works if I replace the get line with:
"get *30082019*.txt" (or any other date)
I cannot figure out what parameter I'm missing.
Thanks again :)

Re: filemask script help needed please

It's like:
"get -filemask=*.TXT>yesterday" ^
See the examples in:

Note that 0DS is today, while 1DS is yesterday (I'm not sure which one you want).

filemask script help needed please


I've sat and read the documentation for the last few hours and tried many combinations, but cannot figure out the syntax for what I'm trying to achieve. All I want is to connect to the remote directory and use a filemask to grab only the .txt files that were modified/created since midnight last night (we have around 90 files arriving each morning).
Looking at the docs, where it mentions being able to use '>yesterday' or '>0DS' makes me think it's simple, but none of these work in my batch file:
"get -filemask=*>yesterday *.TXT" ^
"get -filemask=*>0DS *.TXT" ^
"get -filemask=>1DS *.TXT" ^

I have no idea what I'm doing wrong.
The Transfer Settings Dialog is even more confusing. If I try adding:
>yesterday or >0DS in the filemask box, it refuses to allow it. Yet the docs say you can use >yesterday or >0DS as a filemask.

Please help before I have a nervous breakdown :)

Thank you!