Get -delete not deleting remote files

Advertisement

sublimnl
Guest

Get -delete not deleting remote files

Hi,

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.

Thanks!

Reply with quote

Advertisement

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

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.

Reply with quote

sublimnl
Joined:
Posts:
2

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.

Reply with quote

sublimnl
Joined:
Posts:
2

OK, its not working again for some reason. Please see attached log. I am running the following command:

winscp.com /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://syncuser:password@django.ayas.cc
option batch on
option confirm off
cd /var/opt/Downloads/
get -delete -resume -filemask="*.txt| .*/" * D:\Test\
exit
  • winscp2.log (35.71 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar

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.

Reply with quote

Advertisement

You can post new topics in this forum