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

I'm not sure I understand your problem fully, but maybe you are looking for this:
put -delete -filemask=*/ X:\(LocalPath)\* /(RemotePath)/" ^ 
jkn

Hello again
    "rm /IN/*.txt" ^

deletes *.txt without the note and doesn't delete the /IN directory

Works fine - thx

;)
jkn

hi,

similar problem
    "get /imp -filemask=*.txt \pfad\imp" ^
    "rm /imp *.txt" ^

deletes the whole /imp folder?
    ...
    "rm /imp/ *.txt" ^

works so far with a note in the logfile that the slash isn´t clearly.
Sundance

I figured that using the put command with -delete, this gets much easier. The only thing that doesn't seem to work, is syncing ALL files AND folders within the local folder, without deleting the local folder itself.

I'm currently using this command in a bat script:

put -delete -filemask=*/ X:\(LocalPath)\ /(RemotePath)"^ 

It syncs fine, but deletes the LocalPath folder. I can't seem to find a filemask that works. Using *.* doesn't sync the first folder within the localpath, but only it's subfolders.

THanks in advance for any help!

Sundance
Sundance

PowerShell Help: Delete local files after sync

Dear WinSCP-users,
i'm currently trying to find a way to sync the contents of a local folder to a remote folder and delete the local files after a successful transfer.
I found this PowerShell script, but it does it the other way round..
https://winscp.net/eng/docs/library_example_delete_after_successful_download

I'm unfortunately not a PowerShell expert so i'm having difficulties understanding what i need to change.

I changed the SynchonizationMode and the sync works when i execute the script. But the deletion won't work and i don't know what to change.
Any help is greatly appreciated :)

Thanks in advance

Sundance