trying to download group of files with similar names in a script

Advertisement

Muchohombre
Joined:
Posts:
2
Location:
Michigan

trying to download group of files with similar names in a script

I have a 2 groups of files. One starts with CERR the other starts with AERR. After that is the date then .pdf ex. CERR20210506.pdf. I would like to download all the files that start with CERR but I can't get it to work and I've looked all over. This is my script:
option batch abort
OPTION CONFIRM OFF
open sftp://DOSxxx:JMSINCxxx@136.182.135.34:2222
bin
get  CERR*.PDF
exit
If I specify the exact file name it works, but I can't get it to do multiple files.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
36,052
Location:
Prague, Czechia

Re: trying to download group of files with similar names in a script

Your script looks correct. If it does not work, 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

Muchohombre
Joined:
Posts:
2
Location:
Michigan

Re: trying to download group of files with similar names in a script

martin wrote:

Your script looks correct. If it does not work, please attach a full session log file showing the problem (using the latest version of WinSCP).

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
36,052
Location:
Prague, Czechia

Re: trying to download group of files with similar names in a script

The log shows that there are these files in the initial directory /DOSCHB:
AERR078D.210514.0039.311xuhkj
OUT078D.210514.0038.431bgbcq
AERR078D.210513.0131.162gvqll
AERR078D.210512.0139.050hxyzm
AERR078D.210511.0145.280ctx4x
AERR078D.210508.0045.045j325t
FAC078D.210508.0043.1058l0bn
AERR078D.210507.0057.3070sy3h
AERR078D.210506.0001.398uw65d
CERR078D.210501.0044.00yd3sqd
No .pdf files.

Reply with quote

Advertisement

You can post new topics in this forum