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

Advertisement

bagdrums
Joined:
Posts:
6
Location:
uk

%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)
Last edited by bagdrums on 2024-05-20 12:23; edited 2 times in total

Reply with quote

Advertisement

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

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.

Reply with quote

bagdrums
Joined:
Posts:
6
Location:
uk

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

Reply with quote

bagdrums
Joined:
Posts:
6
Location:
uk

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.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum