- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Does cksum work for folders
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2005 06:56 AM
09-12-2005 06:56 AM
Does cksum work for folders
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.
So I have couple of questions here,
1. Does cksum work for folders with some option?
2. If not, is there any way to validate the data integrity of the folders in question?
Let me know.
Thanks,
Roshan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2005 07:08 AM
09-12-2005 07:08 AM
Re: Does cksum work for folders
foldersum=0
for file in `ls -1 /my/directory/level/*`
do
cs=`cksum $file`
(( foldersum=$foldersum+$cs ))
done
echo $foldersum
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.
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2005 07:15 AM
09-12-2005 07:15 AM
Re: Does cksum work for folders
Create a script like this:
find . -type f -print | sort | while read FNAME
do
cksum "${FNAME}"
done
--------------
Now cd to source directory and run the above script:
sh myscript.sh > /var/tmp/src.txt
Next, cd to destinationation directory and run the script again.
sh myscript.sh > /var/tmp/dest.txt
Next diff the two files:
diff /var/tmp/src.txt /var/tmp/dest.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2005 08:52 AM
09-12-2005 08:52 AM
Re: Does cksum work for folders
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.
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.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 03:12 AM
09-13-2005 03:12 AM
Re: Does cksum work for folders
If you have to distribute the same directory or files to multiple servers, you should use rdist, or get rsync.
(from : http://samba.anu.edu.au/rsync/)
rdist will do binary comparisons of files and update only if they differ.
See man rdist
Regards,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 03:28 AM
09-13-2005 03:28 AM
Re: Does cksum work for folders
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 04:43 AM
09-13-2005 04:43 AM