cksum problem in unix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amitv
    New Member
    • Jan 2010
    • 3

    cksum problem in unix

    I am trying to compare cksum of 5 files in four different directories . The cksum of files in three directories on same server is same but the cksum of the files in the directory on another server is different. why is this happening?

    Output on one server:
    2741269201 1822 NRBGDWTESPTE000 0002
    475751410 11887 NRBGDWTESPTE000 0003
    917092061 22198 NRBGDWTESPTE000 0004
    1352351944 18683 NRBGDWTESPAT000 0005
    1606943972 2908 NRBGDWTESPAT000 0006


    and on another:

    3867478739 1822 NRBGDWTESPTE000 0002
    45210552 11887 NRBGDWTESPTE000 0003
    734824348 22198 NRBGDWTESPTE000 0004
    3795910800 18683 NRBGDWTESPAT000 0005
    2828274160 2908 NRBGDWTESPAT000 0006




    The code I am using to get cksum from remote server is :
    check_sum=`ssh $bound_host " cd ${dest_dir}; ls -lrt $l | cksum $l "`
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    It happens because the files are different?

    Comment

    • shabinesh
      New Member
      • Jan 2007
      • 61

      #3
      The hash code is unique for different files, and a file cannot have different hash codes. the fourth file must have changed or it should be different.

      Comment

      • amitv
        New Member
        • Jan 2010
        • 3

        #4
        same files

        But my script is copying the same files to all the directories as u can see file sizes are same

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          File sizes don't mean much. You can tell this because the check sum is wrong.

          Try a different check sum algorithm. Like MD5 or one of the SHAs.

          Comment

          Working...