MD5/SHA-based synchronization

Advertisement

mfidemraizer
Guest

MD5/SHA-based synchronization

Hi!

I'm trying to optimize a WinSCP script that executes a
synchronize
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]

Reply with quote

Advertisement

JeroenE
Joined:
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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: MD5/SHA-based synchronization

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

Reply with quote

Advertisement

You can post new topics in this forum