1855564 Members
11251 Online
104112 Solutions
New Discussion

checksum utility

 
SOLVED
Go to solution
Shivkumar
Super Advisor

checksum utility

Hi,

The checksum utility is being used for checking or testing the integrity of binary/text files when these files are transferred between 2 servers/machines or operating system.

my question is; what are the various causes which alters integrity of any files so that it needs to be checked or verified by checksum ?

Thanks,
Shiv
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor
Solution

Re: checksum utility

Hi Shiv:

Probably the most likely cause of loss of file integrity is a partial file transfer during an FTP (or other transfer) session.

It is also possible to transfer a file that is actively begin written to or modified during the transfer period.

In either case, above, the use of a checksum utility ('cksum' or better yet, 'md5') will provide assurance that the file is the same at both the source and destination points.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: checksum utility

The factors that can cause corruption in a file transfer are the unknowns in your network. If your network archaic hubs to interconnect your computers, you'll have reliability problems. If the other machine is across a WAN, you may have uncontrollable error condition. If the data is unimportant to you, don't bother with checksums. But if this is critical production data, I would always perform a checksum.


Bill Hassell, sysadmin
Raj D.
Honored Contributor

Re: checksum utility

Shiv,

Integrity of a file needs to be check in order to check the data consistancy on that file , because it may experience some data loss during a file transfer or because of a network issue. checksum utility (cksum) uses a portable algorithm based on a 32-bit Cyclic Redundancy Check. This algorithm finds a broader spectrum of errors than the 16-bit algorithms used by sum.

cksum , uses sum(1) and checks blocks and byte counts of a file. sum is typically used to verify data integrity when copying files
between systems.

For further details: man cksum ; man sum


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Tor-Arne Nostdal
Trusted Contributor

Re: checksum utility

Scenario:
Online files which should be static/unchanged for many years...

Successful file transfer is the most common purpose, but I have also used it to monitor that files do not change over time by accident...

So after the file(s) have been saved you get the checksum of the criticalfile and store it. On regulare basis you verify that the checksum for the file(s) does not change.

If the checksum changes you issue a notification.

A notification could give you opportunity to do a fast recover of the file from backup...
If you happen to find out after N years that a file is corrupt you could have problems knowing which file you should restore...

/2r
I'm trying to become President of the state I'm in...
Shivkumar
Super Advisor

Re: checksum utility

I think this checksum numbers generated are in hexadecimal. Is it possible to generate them in octal format ?

Thanks,
Shiv
Bill Hassell
Honored Contributor

Re: checksum utility

Now when you say "checksum", are you referring to either the HP-UX commands sum or cksum? Both of these tools report decimal numbers, not hex. I'm not sure why you would want octal since there is no useful data in these values except to compare with other cksum values.


Bill Hassell, sysadmin