daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jun 10th, 2012 34 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Here is my logic for the comparing of the hash files in case the sync fails again.
  2.  
  3. File: test1
  4. ========================================================
  5. aaa06b08037dbcb62570cb0ef6672734  /TEST1/usr/local/src/md5deep-4.1/src/utf8/unchecked.h
  6. b73d30e88b9db3eab9732728cadabd76  /TEST1/usr/local/src/md5deep-4.1/src/utf8/core.h
  7. 3fc4217e1921d22a854acfbadd82d613  /TEST1/usr/local/src/md5deep-4.1/src/utf8/checked.h
  8. ========================================================
  9.  
  10. File: test2
  11. ========================================================
  12. 0d55a58b2864bd1bcfe8cee37432ea6d  /TEST2/usr/local/src/md5deep-4.1/man/Makefile.in
  13. a6b8c48374b93527a8c085ffdb43ee59  /TEST2/usr/local/src/md5deep-4.1/man/tigerdeep.1
  14. a6b8c48374b93527a8c085ffdb43ee59  /TEST2/usr/local/src/md5deep-4.1/man/whirlpooldeep.1
  15. a6b8c48374b93527a8c085ffdb43ee59  /TEST2/usr/local/src/md5deep-4.1/man/sha1deep.1
  16. a6b8c48374b93527a8c085ffdb43ee59  /TEST2/usr/local/src/md5deep-4.1/man/sha256deep.1
  17. 48cd1b862061561a21312b02c7dcf248  /TEST2/usr/local/src/md5deep-4.1/man/Makefile.am
  18. 1980113e6356c42a59794ad59521d06c  /TEST2/usr/local/src/md5deep-4.1/man/hashdeep.1
  19. a6b8c48374b93527a8c085ffdb43ee59  /TEST2/usr/local/src/md5deep-4.1/man/md5deep.1
  20. 69e6f6ce3d3e91d83a212d3ae3740233  /TEST2/usr/local/src/md5deep-4.1/man/Makefile
  21. b73d30e88b9db3eab9732728cadabd76  /TEST2/usr/local/src/md5deep-4.1/src/utf8/core.h
  22. aaa06b08037dbcb62570cb0ef6672734  /TEST2/usr/local/src/md5deep-4.1/src/utf8/unchecked.h
  23. 3fc4217e1921d22a854acfbadd82d613  /TEST2/usr/local/src/md5deep-4.1/src/utf8/checked.h
  24. ========================================================
  25.  
  26. $sort test* | uniq -c -w 32 | grep "^      1 "
  27.  
  28. Basically I am reading both files (test*) and sorting them. Then I am showing the number of occurrences for the first 32 characters(THE HASH). Then I filter the listing by files with only 1 occurrence. This will allow me to see which side has a file and which side doesn’t to determine a copy or a delete.
  29.  
  30. Does this look or at least sound logical?
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top