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: Delete remote files, but not remote directories

I'm afraid there's no simple solution for this using WinSCP.
oced

Re: Delete remote files, but not remote directories

martin wrote:

Do you ant to delete a contents of the directories? I.e. to keep just directory structure?


Yes. That's it exactly: keep just the remote server's directory structure after I've downloaded the files.

Thanks.
martin

Re: Delete remote files, but not remote directories

Do you ant to delete a contents of the directories? I.e. to keep just directory structure?
oced

Delete remote files, but not remote directories

Greetings:

First, I'd like to say what a great program winscp is.

I've been tasked with automating the downloading of files from a remote server using a script. My requirements are:

    1. Download all files and directories from the remote host
    2. After downloading the files, I have to delete the remote files but NOT the remote directories.
    3. I won't know ahead of time the names of the files or directories so I can't put those into my script.
    4. My remote user id is a virtual user so I cannot use SSH to login after downloading and use standard Unix commands to delete the remote files.

I've been able to recursively download my test files and directories with no problem at all. When I add the -delete option to get, it deletes all of the directories and sub-directories too. More deleting than I want. My command is

get -preservetime -delete *.*

Any ideas about how I can delete the remote files but not the remote directories? Thanks.