# arrange de-duplicate and arrange photos and movies into a content-addressed store, with hardlinks by date. out/content/ab/cdef….jpg one copy of each file, named by its sha256 out/date/2006/03/1143508767….jpg hardlinks to those, by capture time Capture time comes from exif (jpeg, heic, camera raw), the QuickTime movie header (mov, mp4, m4v, 3gp), or the file's mtime as a last resort. ## usage go install mcquay.me/arrange/cmd/am@latest # where's the media? per folder: images, raw, videos, videos over 1G # (ripped movies stand out), sizes. Only stats files. Prints folder names. am survey ~/Pictures am survey -depth=2 ~/Pictures # pick what to grab: -kinds is any of image,raw,video (default all), and # -exclude skips matching file or folder names (repeatable) am arr -n -kinds=image ~/Pictures /mnt/store am arr -n -exclude=VIDEO_TS -exclude='*.vob' -exclude=DVDs ~/Pictures /mnt/store # see what would happen; prints new/dupsrccontentdate dir am arr -n ~/Pictures /mnt/store > plan.tsv # do it; nothing in the source is changed am arr ~/Pictures /mnt/store # re-hash the store: corrupt files, orphans, leftovers from crashed runs am verify /mnt/store # turn dated files that are copies rather than hardlinks back into links am clean -n /mnt/store am clean /mnt/store # print the time and path am would use for some files am meta a.jpg b.mov `arr` ends with a summary of counts and sizes by extension and year. It names no files, so it is safe to share. Stores made before sha256 use md5 names; add to one with `-hash=md5`. `verify` works out the hash from each name's length.