Cannot download using sftp

Advertisement

roshan
Joined:
Posts:
3

Cannot download using sftp

Hi:

I want to download file automatically.I saved this script in .txt file and call the .txt file in command prompt:-

# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect
open "CDN" -hostkey="ssh-rsa 1024 fe:8f:d9:c0:5b:a4:f8:bf:91:4f:80:41:36:7b:38:87"
# Change remote directory
cd /home/user
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get test.txt c:\
# Disconnect
close
# Exit WinSCP
exit

I can see that it is connecting but it doesnt copy file to c:\.Any idea where is the problem

Reply with quote

Advertisement

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

Re: Cannot download using sftp

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

To generate log file, use /log=path_to_log_file 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 may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

Reply with quote

roshan
Joined:
Posts:
3

Re: Cannot download using sftp

Hi :

I fixed it. But when i run the command it copies folder and subfolders.How can i just copy the file and not folder and subfolder structure. .The command is below:-

get -filemask=FULL_us_chhc_*2013*.txt /pc/user1/backup/backup/backup/* c:\

Regards,
Roshan

Reply with quote

martin
Site Admin
martin avatar

Re: Cannot download using sftp

roshan wrote:

How can i just copy the file and not folder and subfolder structure.
You cannot.

Reply with quote

Guest

Re: Cannot download using sftp

ok.Is there any way i can copy the file if it exists in any subfolder.What i am trying to do is user will enter file name and it needs to be copied to local server .The file can reside in any folder/subfolder

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum