Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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?
etbur

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