Topic "Batch Upload Overwriting Remote Files"

Author Message
TokyoBrit

Guest


I use the winscp.com 4.2.8 command line version to upload all the files in a folder to a remote location via SFTP, however it is overwriting the destination files even if I set the Confirm option to ON.

"c:\program files\winscp\winscp.com" /script=uploadscript.txt /log=log.txt

option batch on
option confirm on
open sftp://user:password@ftp_server:22
put -nopreservetime "C:\Twl_Get\rcvdata\*.txt"
close
option confirm off
option batch off
exit

I can get around this some by using the synchronize command, which will only upload files that are different, however our SFTP server does not support a client making changes to the timestamp, which is why I use the -nopreservetime flag in the PUT.

This flag does not exist for SYCNHRONIZE, and the -nopermissions doesn't stop an error from occuring, so I need to set BATCH CONTINUE.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
There's no easy solution with WinSCP only for you then. You would have to make script/application that drive WinSCP and compares the files before transfer.
_________________
Martin Prikryl
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