Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: MD5/SHA-based synchronization

WinSCP does not support this, as actually very few servers do provide interface for calculating checksums of remote files.

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.

MD5/SHA-based synchronization


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]