Download files

Advertisement

Blisk
Joined:
Posts:
5
Location:
Slovenia

Download files

how can I make a script to download files from remote server, to local server.
I have folders and subfolders and files in all of it and want exact copy to download to local server.
I know how to upload but can't download files and folders.
Can someone help me with this, please ?

Reply with quote

Advertisement

Blisk
Joined:
Posts:
5
Location:
Slovenia

Here is my uplod script, but don't know how to make it download?
On these links there is no download!

# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect
open sftp://username:password@192.168.333.191/ -passive=on -neweronly -hostkey="ssh-rsa 2048 fc:16:80:99:38:ef:c6:7d:22:9a:23:59:17:93:9e:88"
# Change remote directory
cd /archive/files
# Force binary mode transfer
option transfer binary
# Upload the file to current working directory
put D:\inf\dll\DVD
# Disconnect
close
# Exit WinSCP
exit

Reply with quote

Blisk
Joined:
Posts:
5
Location:
Slovenia

Thank you, I have manage to make script to upload, but it doesn't
recognise any switch
when I put -neweronly -resume
it say
unknown switch "neweronly"
unknown switch "resume"

open sftp://username:password@192.168.333.191/ -passive=on -neweronly -resume -hostkey="ssh-rsa 2048 fc:16:80:99:38:ef:c6:7d:22:9a:23:59:17:93:9e:88"


Also when I download text file it loose lines.
All is in one line and it should be in 10 lines for example.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
30,857
Location:
Prague, Czechia

-neweronly and -resume are switches of the put command, not open.

So it's
put -neweronly -resume ...

Also when I download text file it loose lines.
All is in one line and it should be in 10 lines for example.
The file most probably has unix line endings, and you open it in a editor/viewer which does not support them (like Windows Notepad). You can add -transfer=ascii switch to fix that.

Reply with quote

Advertisement

You can post new topics in this forum