Script per download files

Advertisement

jonathan
Joined:
Posts:
3
Location:
Italy

Script per download files

Hi, I recently discovered WinSCP and so I'm completely unaware of its use.
I ask for help to solve a problem, I need to download files from some PCs that are on different segments of the LAN (e.g. 172.16.7.50 172.16.132.160 172.16.110) and I need a script that queries all of them from a central PC PCs and download some files and put them in some folders. Thanks everyone they will help me.

Reply with quote

Advertisement

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

Re: Script per download files

Sorry, I do not know what "queries all of them from a central PC" means. Do you have some API to retrieve the list of servers?

Reply with quote

jonathan

Re: Script per download files

Hi, let me explain better, from a PC I create a routine that queries the various computers allowing me to download data. Thanks for the kind replies.

Reply with quote

martin
Site Admin
martin avatar

Re: Script per download files

Sorry, that's as vague as before. What is "queries"?
Do you want to write a script that goes over a list of IP addresses/hostnames, connects to each and downloads some specific files from each?

Reply with quote

Advertisement

Guest

Hi, thanks for the time you are dedicating to me, I did as you told me but unfortunately when I launch the script the winscp.com window opens but the cursor remains flashing. What could it depend on?

Reply with quote

Guest

winscp.com
open scp://172.16.........
user
pass
get /usr/tprsystem/validations C:\validations
exit
If it helps you, here is the script I run. If I execute one instruction at a time from the command line everything goes well........

Reply with quote

Advertisement

Guest

Hi, sorry if I'm here again taking up your precious time. The solution you gave me for downloading the files is fine but, the following week, finding the destination folder already full, WinSCP freezes and waits for keyboard input. How can I solve it?
Thank you

Reply with quote

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

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

Advertisement

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

Re: Script per download files

  1. You are using 11 years old WinSCP 5.1.3. You urgently need to upgrade to the latest version.
  2. Your commandline syntax is wrong. It seems that you have something like "/ini" "=nul" there. It should be /ini=nul.
I'm not even sure that any of this is the actual cause of the problem you are facing. But it's hard to help, with all the side effects the above two points cause.

Reply with quote

Guest

Hi, thank you for the valuable advice you give me. I updated the program and now everything works fine except that if you connect to a server and find it "down" the process stops and WinSCP closes. How can I make it go forward by skipping the "down" IP?

Reply with quote

martin
Site Admin
martin avatar

@Guest: If you use the solution, I've pointed you to above, then for each "IP" you start new WinSCP process. So it should not be a problem that WinSCP is closed. If you need further help, show us what exactly are you doing and some logs.

Reply with quote

Guest

Hi, regarding your answer I attach three files, one is the batch, the other the script and the third the generated log. As you can see from the log, the session is interrupted and the program is closed when it connects to the PC with address 172.16.130.158 because it is turned off. How to overcome the inconvenience? Thank you always for your precious advice

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum