From 3c1b8d5c8947bf0aa3e929c21f59eaf06aba33af Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Thu, 14 Apr 2016 17:30:30 +0200 Subject: more general monitor_soft_raid --- duplicates | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 duplicates (limited to 'duplicates') diff --git a/duplicates b/duplicates new file mode 100755 index 0000000..82e72bd --- /dev/null +++ b/duplicates @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby + +dir = ARGV[0] +a = `find #{dir} -type f`.split "\n" + +h = {} +a.each { |fn| + md5 = `md5sum "#{fn}" | cut -d " " -f1` + if h.has_key? md5 + h[md5] << fn + else + h[md5] = [fn] + end +} + +h.each { |k,v| + if v.size > 1 + puts k + v.each { |i| puts "\t#{i}" } + puts + end +} + -- cgit v1.2.3