 |
 |
How to use checksum and md5 when archiving
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2002
Location: Hampshire, England
Status:
Offline
|
|
Hi,
I have no idea how to use md5 or checksum but I have been told I can use these to help me when archiving work.
What I want to do is archive work onto DVD and I would like to produce a checksum of the DVD's content in order that I can quickly verify that the contents are intact (for example when I copy work back from DVD or make a copy of that DVD).
Is it possible to checksum the content of a directory then write it to DVD and save the checksum on the DVD too?
I would appreciate real examples of how to use the cksum/md5 commands as there are no examples given in the man pages.
Many thanks in advance,
John B
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jan 2003
Location: Stuttgart, Germany
Status:
Offline
|
|
Just use md5sum for this purpose:
Code:
find <dir> -type f -print0 | xargs -0 md5sum > digest
This will generate checksums of all files in <dir> and write them to a file called "digest" in the current directory. If you now want to check the integrity of those files, you run
which will then compare the md5s of the files with the ones stored in "digest". You can also wrap all this in a script if you can't remember the exact arguments (at least I can't). Something like this should do:
Code:
#!/bin/sh
find $1 -type f -print0 | xargs -0 md5sum > digest
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Apr 2000
Location: Los Angeles, CA
Status:
Offline
|
|
The purpose of a checksum is to provide programs/users information on the "signature" of a particular file. When copying a file, you basically compare the checksum of the original file (created when the file was first made) with the checksum of the copied file. If the checksums match, then the file was copied exactly. If not, then the new file may have something added or modified, and is not an exact duplicate of the first.
Checksums are popularly used by several Linux distribution sites, to ensure that the CD image you downloaded is an exact duplicate of what was initially made available.
In your setup, you can opt to do one of two things:
- make a checksum of each of the files for archiving
- make a checksum of the disc for archiving
The former is particularly useful when you have individual files that you want to be sure are perfectly intact. The latter is useful if only for distribution of the disc (to make sure that the disc one user has is the same as the original one).
I found some apps in VersionTracker that computes the MD5 hash of a file, but I'm not sure if any of them can do batch jobs. In any case, the applications are: md5app, MD5shot, CheckMate, and checksum+.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2002
Location: Hampshire, England
Status:
Offline
|
|
Thanks for both of those extremely useful replies.
John
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2002
Location: Hampshire, England
Status:
Offline
|
|
Unfortunately I don't have "md5sum" in my version of OS X...
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jan 2003
Location: Stuttgart, Germany
Status:
Offline
|
|
Originally posted by smokingdrum:
Unfortunately I don't have "md5sum" in my version of OS X...
Oops. Turns out it isn't installed by default on OS X. It is actually part of Fink.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Apr 2000
Location: Los Angeles, CA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2001
Location: San Jose CA
Status:
Offline
|
|
Originally posted by smokingdrum:
Unfortunately I don't have "md5sum" in my version of OS X...
On 10.3.x you can get generate an md5 sum for a file in one of two ways:
md5 [file]
or
openssl md5 [file]
Openssl gives you access to several other hashing functions (SHA1, RIPE-160, &c.) in addition to md5.
I'm not sure if this is an issue for you, but not all OSes have a builtin md5 (or md5sum) command, so you may want to also generate a CRC checksum using the cksum command.
--ranga
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|