Topic "MD5/SHA-based synchronization"

Author Message



I'm trying to optimize a WinSCP script that executes a
command to upload files to a given FTP site.

Since the whole script is executed as part as a continuous integration build, it might happen that the source code could be
git clone
'd from scratch, losing file system timestamps. That is, when happens this, the entire site is uploaded to the whole FTP site.

I was wondering if I could implement some custom action to compare the MD5/SHA hash of target and source file, and upload it if the content has changed (the size isn't reliable... it might happen that a code file may weight the same bytes but it may also contain other code...).

Or, is there any built-in feature I could use out-of-the-box?

Thank you in advance[/code]
[View user's profile]

Joined: 2014-02-13
Posts: 9
Location: The Netherlands
I have never used this with synchronize, but what I have done in the past is upload an script file and digest file to checks the checksum and then download the results. I calculated the checksum on the local files to see if everything was the same.

E.g. the scriptfile was something like this
/usr/bin/sha1sum -c "/path/to/dir/filelist.digest" 2>&1 > "results.check"

using the call command I ran this script on the other side.

Of course, you need to be able to run things on the other side for this to work.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
WinSCP does not support this, as actually very few servers do provide interface for calculating checksums of remote files.

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License