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: Synchronization issue - Can't overwrite file

If you are using SFTP protocol, you can force transfer to temporary file name:
https://winscp.net/eng/docs/resume#automatic

That basically does what you ask for.
Guest

Synchronization issue - Can't overwrite file

Hello!
I am scripting a local directory to remote sftp sync. The local source will be changing and the remote sftp destination should always mirror the source exactly.

Script:
option batch continue
option confirm off
open xxx
option transfer binary
synchronize remote \\xxx\yyy\zzz /aaa/bbb -mirror -nopermissions -delete


The sftp server is not allowing changed source files to overwritten as it's against our company policy. When the file sync tries to upload a changed file it fails and continues per the options I have set. If I change the batch option so that I'm prompted to "(D)elete the file", I can answer D obviously and the equivalent of an overwrite occurred, script continues.

MY QUESTIONS:
A) In a put or synchronization operation, is there a way to tell WinSCP to delete a file before uploading a newer version? The overwrite is a 1 step operation to do this, but I need a 2 step delete then put as mandated by our company.
B) Alternatively, is there a way to tell the synchronize command to automatically answer D when prompted?

I am willing to run a beta copy if this functionality is not currently possible but a "2 step overwrite" or "automated prompt answer" switch can be added.

Thanks for your help everyone!
-Mike