Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checksum remote file

Is there a way to get a program I can run via the command line that would do a checksum of a remote file? For instance get a checksum of https://stackoverflow.com/opensearch.xml

I want to be able get an update of when a new rss/xml entry is available. I was thinking I could do a checksum of a file every once in a while and if it is different then there must be an update. I'm looking to write a shell script that checks new rss/xml data.

like image 555
rich Avatar asked Jul 23 '11 16:07

rich


People also ask

Does WinSCP do checksum?

The script is distributed in WinSCP installer as a WinSCP extension. Note that calculation of a remote file checksum is supported with SFTP and FTP protocols only, subject to support of respective protocol extension.

What is checksum of a file?

A checksum (also sometimes referred to as a hash) is an alphanumeric value that uniquely represents the contents of a file. Checksums are often used to verify the integrity of files downloaded from an external source, such as an installation file. You can also use checksums to verify the integrity of your own files.


1 Answers

A quick way to do this with curl is to pipe the output to sha1sum as follows:

curl -s http://stackoverflow.com/opensearch.xml|sha1sum
like image 113
elec3647 Avatar answered Sep 29 '22 12:09

elec3647