Get in script is deleting files unexpectly

Advertisement

etbur
Joined:
Posts:
1
Location:
NYC

Get in script is deleting files unexpectly

I wrote the simple script below to download files from an SFTP server. While it downloaded the files successfully, it also deleted them from the server. Reading through the documentation, I thought that the files would only be deleted if I used the -delete argument in the get command. Please advise. Thanks!

# Connect
open sftp://user:password@site.com
# Change remote directory
cd /incoming
# Download file to the local directory d:\
get * c:\users\me\desktop\TestWinScp\
# Disconnect
close
exit

Reply with quote

Advertisement

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

Re: Get in script is deleting files unexpectly

That script won't delete any files indeed.
If they are get deleted, it must be a behavior of the FTP server.
Don't they get deleted too, if you download them in WinSCP GUI or any other FTP client?

Reply with quote

Advertisement

You can post new topics in this forum