Does SFTP and WinSCP support "intelligent" uploading of "only changed" files?

1

1

If I script-connect to a webhost space with SFTP, using WinSCP, and "PUT" a local dir tree called "My Website" to the remote dir, I assume that it will successfully upload it the first time, with any sub-dirs and sub-files inside intact.

However, then I might change one little file somewhere inside of that dir tree, let's say obscure.html, and run the script again to "sync" the remote dir tree with the local one. However, now it will probably say "File X already exists. Overwrite?" or something like that. How can I make sure that it doesn't prompt me whatsoever for files which already exist, and don't try to upload files which have not changed?

In my scenario, I only want obscure.html to fly across the cables to the remote server, whereas all the others are detected (somehow, I guess by checking the hash checksums?) to be existing and unmodified, and thus there is no point in trying to upload those or prompt me.

Also, I can't just "try it myself" because I'm still pre-working on this whole setup, only purchasing webhost space when I'm finally ready to launch it. (I've been bitten too many times in the past by first buying the servers and domains and stuff and then realizing that the project never got finished.)

Bernard

Posted 2020-01-08T18:30:40.310

Reputation: 11

Answers

0

WinSCP has "synchronization" function. It does what you want. It uploads only new and modified files. And does not prompt for overwrite.

enter image description here

Note that this has nothing to do with SFTP protocol as such. It's purely a functionality of the client (WinSCP).

Martin Prikryl

Posted 2020-01-08T18:30:40.310

Reputation: 13 764