I have a bunch of servers which build various different programs for various different systems.
Once a build has completed, it gets archived into a single file and compressed, then an md5sum
is created of the file. One server might build multiple different versions, resulting in multiple archive files and archive.md5 files.
Finally, a script runs on various other servers that checks the md5sum
s of each file, compares them to the local md5sum
s, and if they are different, downloads and unpacks the updated build.
Currently, the md5sum
check happens as scp [email protected] /path/to/builds/*.md5 .
followed by a comparison of the md5s for each build.
99% of the runtime of the script is the scp
(even though it only takes a few seconds). I am looking to optimize that data transfer as much as possible. The request comes from servers that are whitelisted (or can be, if the solution has its own port), and the data itself is meaningless anyway, so I don't need to worry about either authentication or encryption. I believe that scp
was used out of convenience by my predecessor when there were far fewer servers, versions, and builds.
I have full root access to all servers, so I can do whatever I like. What would be the fastest way to get the .md5
data from the remote server? It could be either the files themselves, or the content of the files (e.g. from cat /path/to/builds/*.md5
).
Thanks!