checksummer

checksummer replaces all files in a given directory with symlinks to files named and hashed by MD5 checksum of each file.

Usage

checksummer <directory_to_checksum> <directory_to_write_data> [OPTIONS]

Options:
  --sleep TIME     Sleep for TIME milliseconds after each symlink operation (for fair IO)

Example

checksummer /music /data

Jay-Z - The Blueprint 3

source                                                                                                destination
/music/jay-z/the_blueprint_3/01-what_we_talkin_about.mp3                                        =>    /data/3/6/a/5/36a5642b1613bf5589cb479332bddca6
/music/jay-z/the_blueprint_3/02-thank_you.mp3                                                   =>    /data/5/1/e/8/51e896f5544b9372edbdf7ec853892a1
/music/jay-z/the_blueprint_3/03-doa.mp3                                                         =>    /data/1/e/7/a/1e7aa593020b60e6b45d0178e49d0413 (duplicate)
/music/jay-z/the_blueprint_3/04-run_this_town.mp3                                               =>    /data/1/f/4/5/1f454817ee460e28ede71b5e5ee902bd (duplicate)
/music/jay-z/the_blueprint_3/05-empire_state_of_mind.mp3                                        =>    /data/4/9/d/3/49d39143e0c42e4c2b852f604938c0d0 (duplicate)
/music/jay-z/the_blueprint_3/06-real_as_it_gets.mp3                                             =>    /data/9/8/8/d/988d10054f0eceb5def18bbb2c453557
/music/jay-z/the_blueprint_3/07-on_to_the_next_one.mp3                                          =>    /data/e/f/8/0/ef80c8b3560b5e1c15c919f354d226f8
/music/jay-z/the_blueprint_3/08-off_that.mp3                                                    =>    /data/3/6/a/8/36a8152e0d98ccd6a375a8ab489cd4a1
/music/jay-z/the_blueprint_3/09-a_star_is_born.mp3                                              =>    /data/4/f/0/f/4f0f8253196a98fb54bed89a3768fb8b
/music/jay-z/the_blueprint_3/10-venus_vs_mars.mp3                                               =>    /data/3/6/1/c/361cba2aaa0d42bc376187a49448fa45
/music/jay-z/the_blueprint_3/11-already_home.mp3                                                =>    /data/d/4/a/7/d4a7756791dbd6df6514c84262b9bb18
/music/jay-z/the_blueprint_3/12-hate.mp3                                                        =>    /data/4/a/6/d/4a6d2a9d04778ead9b04d7f45be1e6bd
/music/jay-z/the_blueprint_3/13-reminder.mp3                                                    =>    /data/c/e/7/4/ce74f6184af8acc3af232df9b9335a76
/music/jay-z/the_blueprint_3/14-so_ambitious.mp3                                                =>    /data/0/d/6/1/0d6140d1a1c681b1f9f5eba7dee523e9
/music/jay-z/the_blueprint_3/15-young_forever.mp3                                               =>    /data/f/0/2/1/f0212f638eea55b9d5815515d40e9787

Jay-Z - The Hits Collection Volume One

 source                                                                                                destination
/music/jay-z/the_hits_collection_volume_one/01-public_service_announcement_(interlude).mp3      =>    /data/a/c/1/a/ac1a8c0df8971e732f034a2c6efa6fc1
/music/jay-z/the_hits_collection_volume_one/02-run_this_town.mp3                                =>    /data/1/f/4/5/1f454817ee460e28ede71b5e5ee902bd (duplicate)
/music/jay-z/the_hits_collection_volume_one/03-03_bonnie_&_clyde.mp3                            =>    /data/d/9/6/5/d9659ed413e0be456c35521639953724
/music/jay-z/the_hits_collection_volume_one/04-encore.mp3                                       =>    /data/c/7/c/e/c7ce40508cb1cacf56cbd671bd1adfb8
/music/jay-z/the_hits_collection_volume_one/05-i_just_wanna_love_u_(give_it_2_me).mp3           =>    /data/e/1/9/f/e19fa1483b208e75792b30d8562aaed0
/music/jay-z/the_hits_collection_volume_one/06-izzo_(hova).mp3                                  =>    /data/1/a/a/a/1aaabf78c9d8e30745b3fc8b2e87e285
/music/jay-z/the_hits_collection_volume_one/07-doa_(death_of_auto-tune).mp3                     =>    /data/1/e/7/a/1e7aa593020b60e6b45d0178e49d0413 (duplicate)
/music/jay-z/the_hits_collection_volume_one/08-99_problems.mp3                                  =>    /data/7/6/b/6/76b689ae2f65bc44340a4bc2831cd559
/music/jay-z/the_hits_collection_volume_one/09-empire_state_of_mind.mp3                         =>    /data/4/9/d/3/49d39143e0c42e4c2b852f604938c0d0 (duplicate)
/music/jay-z/the_hits_collection_volume_one/10-dirt_off_your_shoulder.mp3                       =>    /data/3/2/c/5/32c5218d1a460a6257ab6b7aad23add9
/music/jay-z/the_hits_collection_volume_one/11-hard_knock_life_(ghetto_anthem).mp3              =>    /data/3/5/9/9/3599648c6dfba16787a0f27b2593c624
/music/jay-z/the_hits_collection_volume_one/12-show_me_what_you_got.mp3                         =>    /data/1/a/3/8/1a38f265b1e40d5fc7e1c1814eecc887
/music/jay-z/the_hits_collection_volume_one/13-roc_boys_(and_the_winner_is).mp3                 =>    /data/f/8/7/5/f875b6de8e2f7fd5366a209a1ec225c2
/music/jay-z/the_hits_collection_volume_one/14-big_pimpin.mp3                                   =>    /data/e/9/e/b/e9ebaa49726d7ac990c4eb57fc8eee59

Advantages

  • Save space: dulicate files are replaced with symlinks to one file

  • Partition data uniformly on multiple disks: /data/ could be symlinked to e.g. /dev/disk1 /data/ could be symlinked to e.g. /dev/disk2

Contributing to checksummer

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Tobias Schwab. See LICENSE.txt for further details.