Posted: 2013-10-11 17:28
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.
option batch continue
option confirm off
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.
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!
Location: Prague, Czechia
If you are using SFTP protocol, you can force transfer to temporary file name:
That basically does what you ask for.
You can post new topics in this forum
And it's free!