Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

bagdrums

Any idea How I download all files EXCEPT filenames containing the current month and Year

Any idea how I download all files EXCEPT filenames containing the current month and year.
So if the current month is 06-2024
and the remote server has a file called 05-2024 and another called 06-2024, I want to just download last months filename 05-2024.
I want to embed the commands in a batch file by the way.
bagdrums

Log file now uploaded as requested

Hi
I have now added the log file as suggested. I tried the command with and without the Delete command to see if that helped
ie
I tried both
Get delete  "*%TIMESTAMP-M#MMYYYY%*.CSV
 

as well as
Get  "*%TIMESTAMP-M#MMYYYY%*.CSV
 

I have double checked that the foldername exists on the remote server.
D:\wsftp-files\users\GW_Test
martin

Re: %TIMESTAMP% Command not downloading previous month's file – any advice?

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
bagdrums

%TIMESTAMP% Command not downloading previous month's file – any advice?

Hi
I am trying to get the WinSCP command line to download a file that has last month's (April) Month (MM) and Year (YYYY) number embedded within the filename.
Time of writing is 17th May 2024 so I am expecting the command below to download my April 2024 file located on the remote server – Filename is 042024.CSV
The syntax I am using is:
Get delete  "*%TIMESTAMP-M#MMYYYY%*.CSV
 

The script output is:-
No file matching '*%TIMESTAMP-M#MMYYYY%*.CSV' found.

Does anyone have any ideas please
I am using the latest version of WinSCP - 6.3.3
(Time of writing is 20/5/24)