Re[2]: cksum entire dir??

2012-10-05 Thread Австин Ким
Thu, 4 Oct 2012 22:28:03 -0400 от Mike Jeays mike.je...@rogers.com: rsync --dry-run may be a simple solution that would meet your needs? You might need to add the --delete option. Take another look at man rsync. Yeah, that's exactly what I was looking for! Or to be precise:

Re: cksum entire dir??

2012-10-04 Thread Австин Ким
Hi, all, Paul Kraus paul at kraus-haus.org writes: On Tue, Sep 11, 2012 at 9:18 PM, kpneal at pobox.com wrote: It's a real shame Unix doesn't have a really good tool for comparing two directory trees. You can use 'diff -r' (even on binaries), but that fails if you have devices, named

Re: cksum entire dir??

2012-10-04 Thread Mike Jeays
On Fri, 05 Oct 2012 05:36:19 +0400 Австин Ким avs...@mail.ru wrote: Hi, all, Paul Kraus paul at kraus-haus.org writes: On Tue, Sep 11, 2012 at 9:18 PM, kpneal at pobox.com wrote: It's a real shame Unix doesn't have a really good tool for comparing two directory trees. You can

Re: cksum entire dir??

2012-09-14 Thread C. P. Ghost
On Thu, Sep 13, 2012 at 9:18 PM, Karl Vogel vogelke+free...@pobox.com wrote: Here's a simple, system-independent way to find duplicate files. All you There's also sysutils/samefile: http://www.schweikhardt.net/samefile/index.html -cpghost. -- Cordula's Web. http://www.cordula.ws/

Re: cksum entire dir??

2012-09-14 Thread Karl Vogel
On Thu, 13 Sep 2012 23:35:22 -0400, kpn...@pobox.com said: K But in both your and my code the uniq will frequently fail because the K input is not sorted. No, check the first command: me% find . -type f -print0 | xargs -0 md5 -r | sort /tmp/sig1

Re: cksum entire dir??

2012-09-13 Thread Jonathan McKeown
On Wednesday 12 September 2012 22:29:45 Gary Kline wrote: how, with mtree, could I tell whether dir1 == dir2 or not? From the manpage: ``The mtree utility compares the file hierarchy rooted in the current directory against a specification read from the standard input. Messages are

Re: cksum entire dir??

2012-09-13 Thread markham breitbach
From: Gary Kline kl...@thought.org Subject: Re: cksum entire dir?? On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: [sneck] are you sure it's not 'md5sum' ? ... that seems to be on all my GNU/Linux machines. yup, you be right. altho we have no md5 [[does FBSD?]], fedora

Re: cksum entire dir??

2012-09-13 Thread Gary Kline
On Thu, Sep 13, 2012 at 10:23:47AM +0200, Jonathan McKeown wrote: On Wednesday 12 September 2012 22:29:45 Gary Kline wrote: how, with mtree, could I tell whether dir1 == dir2 or not? From the manpage: ``The mtree utility compares the file hierarchy rooted in the current directory

Re: cksum entire dir??

2012-09-13 Thread Karl Vogel
Here's a simple, system-independent way to find duplicate files. All you need is something to generate a digest you trust (MD5, SHA1, whatever) plus normal Unix stuff: awk, expand, grep, join, sort, and uniq. Generate the signatures: me% cd ~/bin me% find . -type f -print0 | xargs -0 md5 -r

Re: cksum entire dir??

2012-09-13 Thread Polytropon
On Wed, 12 Sep 2012 10:46:25 -0700, Gary Kline wrote: On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory and could obtain a checksum - so it _seems_ to work. After alteration of one file within the hierarchy a

Re: cksum entire dir??

2012-09-13 Thread Waitman Gobble
On Thu, Sep 13, 2012 at 8:35 PM, kpn...@pobox.com wrote: On Thu, Sep 13, 2012 at 03:18:43PM -0400, Karl Vogel wrote: Here's a simple, system-independent way to find duplicate files. All you need is something to generate a digest you trust (MD5, SHA1, whatever) plus normal Unix stuff:

Re: cksum entire dir??

2012-09-12 Thread Matthew Seaman
On 12/09/2012 00:14, Polytropon wrote: % cksum directory and could obtain a checksum - so it _seems_ to work. After alteration of one file within the hierarchy a different result was printed. That will give you a checksum on the directory inode -- file names and associated metadata

Re: cksum entire dir??

2012-09-12 Thread Jonathan McKeown
On Wednesday 12 September 2012 08:31:45 Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory [snip] That will give you a checksum on the directory inode -- file names and associated metadata only, not file content. [snip] Generally I find the best test for

Re: cksum entire dir??

2012-09-12 Thread Matthew Seaman
On 09/12/12 08:12, Jonathan McKeown wrote: Generally I find the best test for differences between old and new copies of a filesystem is 'rsync -avx -n ...' Wouldn't suitable applications of mtree(8) also do what's wanted? TIMTOWTDI. Cheers, Matthew

Re: cksum entire dir??

2012-09-12 Thread Waitman Gobble
On Sep 11, 2012 10:10 PM, Gary Kline kl...@thought.org wrote: On Tue, Sep 11, 2012 at 09:18:13PM -0400, kpn...@pobox.com wrote: On Tue, Sep 11, 2012 at 05:24:08PM -0700, Gary Kline wrote: On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: But I also tried cksum directly with a

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory and could obtain a checksum - so it _seems_ to work. After alteration of one file within the hierarchy a different result was printed. That will give you a

Re: cksum entire dir??

2012-09-12 Thread Waitman Gobble
On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory and could obtain a checksum - so it _seems_ to work. After alteration of one file

Re: cksum entire dir??

2012-09-12 Thread Karl Vogel
On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: G I'm trying to checksum directories as I move them around. ive read the G man page for sum and cksum ... or maybe skimmed them. no joy. anybody G know of a utility to do this? I've got files that are decades old... I wouldn't use

Re: cksum entire dir??

2012-09-12 Thread Mike Jeays
On Wed, 12 Sep 2012 10:55:57 -0700 Waitman Gobble gobble...@gmail.com wrote: On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory and

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 09:12:58AM +0200, Jonathan McKeown wrote: On Wednesday 12 September 2012 08:31:45 Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory [snip] That will give you a checksum on the directory inode -- file names and associated metadata

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: On 12/09/2012 00:14, Polytropon wrote: % cksum directory and could obtain a

Re: cksum entire dir??

2012-09-12 Thread Waitman Gobble
On Wed, Sep 12, 2012 at 2:47 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: On 12/09/2012

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 02:11:05PM -0400, Karl Vogel wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: G I'm trying to checksum directories as I move them around. ive read the G man page for sum and cksum ... or maybe skimmed them. no joy. anybody G know of a utility to do

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 02:31:16PM -0400, Mike Jeays wrote: On Wed, 12 Sep 2012 10:55:57 -0700 Waitman Gobble gobble...@gmail.com wrote: On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline kl...@thought.org wrote: [[ ...]] My Linux system has both md5sum and md5deep. They give the

Re: cksum entire dir??

2012-09-12 Thread RW
On Wed, 12 Sep 2012 14:47:04 -0700 Gary Kline wrote: On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: are you sure it's not 'md5sum' ? ... that seems to be on all my GNU/Linux machines. Waitman Gobble San Jose California USA yup, you be right. altho we

Re: cksum entire dir??

2012-09-12 Thread Waitman Gobble
On Wed, Sep 12, 2012 at 3:22 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 02:31:16PM -0400, Mike Jeays wrote: On Wed, 12 Sep 2012 10:55:57 -0700 Waitman Gobble gobble...@gmail.com wrote: On Wed, Sep 12, 2012 at 10:46 AM, Gary Kline kl...@thought.org wrote:

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 11:39:46PM +0100, RW wrote: On Wed, 12 Sep 2012 14:47:04 -0700 Gary Kline wrote: On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: are you sure it's not 'md5sum' ? ... that seems to be on all my GNU/Linux machines. Waitman Gobble San

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 03:58:00PM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 3:22 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 02:31:16PM -0400, Mike Jeays wrote: On Wed, 12 Sep 2012 10:55:57 -0700 Waitman Gobble gobble...@gmail.com wrote: On Wed,

Re: cksum entire dir??

2012-09-12 Thread Waitman Gobble
On Wed, Sep 12, 2012 at 5:32 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 03:58:00PM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 3:22 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 02:31:16PM -0400, Mike Jeays wrote: On Wed, 12 Sep 2012

Re: cksum entire dir??

2012-09-12 Thread Robert Bonomi
Date: Wed, 12 Sep 2012 14:47:04 -0700 From: Gary Kline kl...@thought.org Subject: Re: cksum entire dir?? On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: [sneck] are you sure it's not 'md5sum' ? ... that seems to be on all my GNU/Linux machines. yup, you be right

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 05:42:43PM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 5:32 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 03:58:00PM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 3:22 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12,

Re: cksum entire dir??

2012-09-12 Thread Gary Kline
On Wed, Sep 12, 2012 at 08:17:16PM -0500, Robert Bonomi wrote: Date: Wed, 12 Sep 2012 14:47:04 -0700 From: Gary Kline kl...@thought.org Subject: Re: cksum entire dir?? On Wed, Sep 12, 2012 at 10:55:57AM -0700, Waitman Gobble wrote: [sneck] are you sure it's not 'md5sum

Re: cksum entire dir??

2012-09-12 Thread Waitman Gobble
On Wed, Sep 12, 2012 at 8:08 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 05:42:43PM -0700, Waitman Gobble wrote: On Wed, Sep 12, 2012 at 5:32 PM, Gary Kline kl...@thought.org wrote: On Wed, Sep 12, 2012 at 03:58:00PM -0700, Waitman Gobble wrote: On Wed, Sep 12,

cksum entire dir??

2012-09-11 Thread Gary Kline
I'm trying to checksum directories as I move them around. ive read the man page for sum and cksum ... or maybe skimmed them. no joy. anybody know of a utility to do this? I've got files that are decades old... tx, guys. gary ___

Re: cksum entire dir??

2012-09-11 Thread Polytropon
On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: I'm trying to checksum directories as I move them around. ive read the man page for sum and cksum ... or maybe skimmed them. no joy. anybody know of a utility to do this? I've got files that are decades old... Maybe it's possible

Re: cksum entire dir??

2012-09-11 Thread Gary Kline
On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: I'm trying to checksum directories as I move them around. ive read the man page for sum and cksum ... or maybe skimmed them. no joy. anybody know of a utility to do this?

Re: cksum entire dir??

2012-09-11 Thread Polytropon
On Tue, 11 Sep 2012 17:24:08 -0700, Gary Kline wrote: On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: I'm trying to checksum directories as I move them around. ive read the man page for sum and cksum ... or maybe

Re: cksum entire dir??

2012-09-11 Thread Noel
On 9/11/2012 7:48 PM, Polytropon wrote: I think I tried something like your second example last night. I think I did % cksum foodir/* That lets the shell expand * to the content of foodir, making a final command line like cksum foodir/file1 foodir/file2 and so on. If you

Re: cksum entire dir??

2012-09-11 Thread Colin Barnabas
On Tue, Sep 11, 2012 at 05:24:08PM -0700, Gary Kline wrote: On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: I'm trying to checksum directories as I move them around. ive read the man page for sum and cksum ... or maybe

Re: cksum entire dir??

2012-09-11 Thread Gary Kline
On Wed, Sep 12, 2012 at 02:48:54AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 17:24:08 -0700, Gary Kline wrote: On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: I'm trying to checksum directories as I move them

Re: cksum entire dir??

2012-09-11 Thread Paul Kraus
On Tue, Sep 11, 2012 at 9:18 PM, kpn...@pobox.com wrote: It's a real shame Unix doesn't have a really good tool for comparing two directory trees. You can use 'diff -r' (even on binaries), but that fails if you have devices, named pipes, or named sockets in the filesystem. And diff or cksum

Re: cksum entire dir??

2012-09-11 Thread Paul Kraus
On Tue, Sep 11, 2012 at 10:03 PM, Gary Kline kl...@thought.org wrote: I'm not concerned about a file having been changed, just whether % cp -rp /home/klinebak/foodir /home/kline/ is 100% reliable. down to the bit! If cp is not reliable (down to the bit), then

Re: cksum entire dir??

2012-09-11 Thread markham breitbach
As long as you are not moving files across mount points, you could always do something like this: cd $SOURCE_DIR find . -print | cpio -dplm $DEST_DIR rm -rf $SOURCE_DIR That will create hard links from one directory to the other so you don't have to worry about any file corruption

Re: cksum entire dir??

2012-09-11 Thread Lowell Gilbert
Paul Kraus p...@kraus-haus.org writes: On Tue, Sep 11, 2012 at 9:18 PM, kpn...@pobox.com wrote: It's a real shame Unix doesn't have a really good tool for comparing two directory trees. You can use 'diff -r' (even on binaries), but that fails if you have devices, named pipes, or named

Re: cksum entire dir??

2012-09-11 Thread Robert Bonomi
Date: Tue, 11 Sep 2012 17:24:08 -0700 From: Gary Kline kl...@thought.org Subject: Re: cksum entire dir?? On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote: I'm trying to checksum directories as I move them around. ive

Re: cksum entire dir??

2012-09-11 Thread Gary Kline
On Tue, Sep 11, 2012 at 09:18:13PM -0400, kpn...@pobox.com wrote: On Tue, Sep 11, 2012 at 05:24:08PM -0700, Gary Kline wrote: On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: But I also tried cksum directly with a directory like % cksum directory and could

Re: cksum entire dir??

2012-09-11 Thread Gary Kline
On Tue, Sep 11, 2012 at 09:55:33PM -0500, Robert Bonomi wrote: Date: Tue, 11 Sep 2012 17:24:08 -0700 From: Gary Kline kl...@thought.org Subject: Re: cksum entire dir?? On Wed, Sep 12, 2012 at 01:14:43AM +0200, Polytropon wrote: On Tue, 11 Sep 2012 14:38:04 -0700, Gary Kline wrote