Post a reply

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)


Topic review


OK, it's due to how an SCP protocol works. When downloading a folder, it deletes the whole folder only after it is completely retrieved. If some files fail to download or are excluded (your case), the folder is not deleted.

If you switch to an SFTP protocol, it would work as your expect.

OK, its not working again for some reason. Please see attached log. I am running the following command: /script=c:\users\home\Documents\WinSCP\django-sync.txt /log=c:\users\home\winscp2.log

Here are the contents of django-sync.txt:

open scp://

option batch on
option confirm off
cd /var/opt/Downloads/
get -delete -resume -filemask="*.txt| .*/" * D:\Test\

Not sure why, but today it is working perfectly. I did not change anything from last week to today. If it starts happening again then I will post a log.

Re: Get -delete not deleting remote files

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 can mark the attachment as private.

Get -delete not deleting remote files


I've been working all afternoon to get this working. I just want to download files from a remote server and delete them when done. I finally got everything working, except the -delete option will not do anything. Here is the command I am using:

get -delete -resume -filemask="*.jpg| .*/" * D:\Test\

The jpg files are downloaded and hidden directories are excluded, but the jpg files are never deleted. Any ideas? I tried logging my output to see if that raised any clues, but nothing is even mentioned in the log about deleting the files.