<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Does cksum work for folders in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624083#M236416</link>
    <description>As usual, UNIX gives you the basic building blocks but what you do with them is up to you. This is a very straightforward script but normally cksum'ing is not necessary because all your need to do is look at the exit status of the copy command. If you are ftp'ing then things are a bit more tricky but even in that case using Perl's Net::FTP package, you get error checking for free.</description>
    <pubDate>Tue, 13 Sep 2005 11:43:35 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-09-13T11:43:35Z</dc:date>
    <item>
      <title>Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624077#M236410</link>
      <description>I have a situations where in I move a folder structure onto multiple servers and have to validate that all the servers have recieved it without any data corruption. &lt;BR /&gt;&lt;BR /&gt;I tried cksum on the folders but it didn't come back with matching results. But if I check the individual files within the folders, those match. &lt;BR /&gt;&lt;BR /&gt;So I have couple of questions here,&lt;BR /&gt;1. Does cksum work for folders with some option?&lt;BR /&gt;2. If not, is there any way to validate the data integrity of the folders in question?&lt;BR /&gt;&lt;BR /&gt;Let me know.&lt;BR /&gt;Thanks,&lt;BR /&gt;Roshan.</description>
      <pubDate>Mon, 12 Sep 2005 13:56:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624077#M236410</guid>
      <dc:creator>Roshan George Cheereth</dc:creator>
      <dc:date>2005-09-12T13:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624078#M236411</link>
      <description>cksum does not have any command line switches of any kind, under 11i. The best would be to use something like &lt;BR /&gt;&lt;BR /&gt;foldersum=0&lt;BR /&gt;for file in `ls -1 /my/directory/level/*`&lt;BR /&gt;do&lt;BR /&gt;cs=`cksum $file`&lt;BR /&gt;(( foldersum=$foldersum+$cs ))&lt;BR /&gt;done&lt;BR /&gt;echo $foldersum&lt;BR /&gt;&lt;BR /&gt;it is not an error proof way butit is highly unlikely that one file will have enough dicrepancy to compensate and zero out the other discrepancies.&lt;BR /&gt;&lt;BR /&gt;Hope this helps</description>
      <pubDate>Mon, 12 Sep 2005 14:08:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624078#M236411</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-09-12T14:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624079#M236412</link>
      <description>First of all, UNIX guys have no idea what a folder is; there is no mkfolder command. Cksum will work on a directory but it is simply the cksum of the directory itself and not of the directory's contents. It is possible to do what you but it would require a script to test each file. Here's another approach that should do what you want:&lt;BR /&gt;&lt;BR /&gt;Create a script like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find . -type f -print | sort | while read FNAME&lt;BR /&gt;  do&lt;BR /&gt;     cksum "${FNAME}"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;--------------&lt;BR /&gt;&lt;BR /&gt;Now cd to source directory and run the above script:&lt;BR /&gt;&lt;BR /&gt;sh myscript.sh &amp;gt; /var/tmp/src.txt&lt;BR /&gt;&lt;BR /&gt;Next, cd to destinationation directory and run the script again.&lt;BR /&gt;&lt;BR /&gt;sh myscript.sh &amp;gt; /var/tmp/dest.txt&lt;BR /&gt;&lt;BR /&gt;Next diff the two files:&lt;BR /&gt;diff /var/tmp/src.txt /var/tmp/dest.txt&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Sep 2005 14:15:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624079#M236412</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-12T14:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624080#M236413</link>
      <description>cksum of a directory won't provide consistent data.&lt;BR /&gt; &lt;BR /&gt;If you cksum a directory before copying, the original directory may have "holes" and left over data from the addition and removal of files under that directory.&lt;BR /&gt; &lt;BR /&gt;When the folder is copied somewhere, the new folder will be cleaned up and thus the cksum will be a different number, even though "logically" the structures are the same.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 12 Sep 2005 15:52:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624080#M236413</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-09-12T15:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624081#M236414</link>
      <description>Roshan,&lt;BR /&gt;&lt;BR /&gt;If you have to distribute the same directory or files to multiple servers, you should use rdist, or get rsync.&lt;BR /&gt;(from : &lt;A href="http://samba.anu.edu.au/rsync/)" target="_blank"&gt;http://samba.anu.edu.au/rsync/)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;rdist will do binary comparisons of files and update only if they differ.&lt;BR /&gt;&lt;BR /&gt;See man rdist&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mark</description>
      <pubDate>Tue, 13 Sep 2005 10:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624081#M236414</guid>
      <dc:creator>Mark Ellzey</dc:creator>
      <dc:date>2005-09-13T10:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624082#M236415</link>
      <description>Thanks guys for the answers. Scripting seems to be the only solution here, I was expecting something smarter like cksum on folders or something close to it.&lt;BR /&gt;&lt;BR /&gt;Rodney, I don't think its due to holes of addition and removal of files. I had thought about it and validated that its not the case.&lt;BR /&gt;&lt;BR /&gt;Mark, I am using rsync but I have seen issues where in it had issues over a large set of servers and a huge folder structure. I wanted an additional validation check apart from running rsync multiple times.</description>
      <pubDate>Tue, 13 Sep 2005 10:28:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624082#M236415</guid>
      <dc:creator>Roshan George Cheereth</dc:creator>
      <dc:date>2005-09-13T10:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Does cksum work for folders</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624083#M236416</link>
      <description>As usual, UNIX gives you the basic building blocks but what you do with them is up to you. This is a very straightforward script but normally cksum'ing is not necessary because all your need to do is look at the exit status of the copy command. If you are ftp'ing then things are a bit more tricky but even in that case using Perl's Net::FTP package, you get error checking for free.</description>
      <pubDate>Tue, 13 Sep 2005 11:43:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/does-cksum-work-for-folders/m-p/3624083#M236416</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-13T11:43:35Z</dc:date>
    </item>
  </channel>
</rss>

