Search code examples
c++windowsqtsftppageant

Update server folder using SFTP and Pageant authentication


Currently I am using psftp.exe on Windows 7 to recursively transfer many files and folders from a local machine to a server. I am using Pageant based authentication for that process. The mechanism works fine using "mput -r" command options.

Now I would like to update (or synchronize) the remote folder based on file time stamps since the amount of files and data increases significantly and I can not afford uploading the big amount of unmodified files each time.

Since the command line call is currently integrated into an C++/Qt application it could be possible to use some C++ or Qt library but due to additional implementation effort I would currently prefer to solve this using psftp.exe if possible.

Is there a way to do such an update/sync easily using psftp.exe that I missed during my research? If not, is there a replacment command that implements Pageant authentication?


Solution

  • The psftp does not support synchronization. Though you can use WinSCP. It supports scripting, synchronization and Pageant authentication as well.

    See the WinSCP guide to automating synchronization.

    (I'm the author of WinSCP)