Topic "Get -delete not deleting remote files"

Author Message
sublimnl

Guest


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:

Code:
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!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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.
sublimnl
[View user's profile]

Joined: 2015-10-01
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.
sublimnl
[View user's profile]

Joined: 2015-10-01
Posts: 2
OK, its not working again for some reason. Please see attached log. I am running the following command:

Code:
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:

Code:
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

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License