Coldcopy by CodeLaw

Free tool · macOS

Sort a folder of photos and videos by the day they were taken

coldcopy-sort is a free terminal command for macOS. Point it at one folder, for example a phone export or a downloaded album. It reads the capture date of every photo and video and copies each file into a folder for its day: 2021/2021-10-16/.

Install in one line

mkdir -p ~/.local/bin && curl -fsSL https://coldcopy.app/coldcopy-sort -o ~/.local/bin/coldcopy-sort && chmod +x ~/.local/bin/coldcopy-sort

Paste it into Terminal. It downloads one Python file into ~/.local/bin. Read the file before you run it.

Run it on one folder

  • ~/.local/bin/coldcopy-sort ~/Pictures/Trip

    shows the plan, then copies after you type y into ~/Pictures/Trip sorted/

  • ~/.local/bin/coldcopy-sort ~/Pictures/Trip --dry-run

    shows the plan only

  • ~/.local/bin/coldcopy-sort ~/Pictures/Trip --into ~/Pictures/By-date

    puts the day folders into another folder

  • ~/.local/bin/coldcopy-sort ~/Pictures/Trip --move

    renames the files into the day folders instead of copying them (same drive only)

It needs python3. The first time, macOS may offer to install its Command Line Tools for it. With exiftool installed (brew install exiftool) it reads the dates of every format exiftool knows; without it, it reads JPEG, HEIC, TIFF-based RAW, MOV and MP4 itself.

What you see before anything changes

coldcopy-sort · Step 3 of 4 · the plan
── Plan: copy 6 files from ~/Pictures/Trip/ into ~/Pictures/Trip sorted/ ──
~/Pictures/Trip sorted/
  2018/2018-03-09/  2 files  1.4 MB
  2019/2019-05-04/  1 files  2.1 MB  · 1 by file date
  2020/2020-07-01/  1 files  48.3 MB
  2021/2021-10-16/  2 files  5.6 MB  · 1 renamed: name taken

  Files: 6 (57.4 MB) in 4 day folders
  By file date (no capture date in the file): 1
    scans/scan.png → 2019/2019-05-04/scan.png
  Renamed because the name is taken in its day folder: 1
    b/IMG_1.jpg → 2021/2021-10-16/IMG_1-2.jpg

Copy 6 files into ~/Pictures/Trip sorted/? [y/N]
What the plan looks like, for an example folder. Nothing is copied until you type y.

What it does, and what it never does

  • It changes nothing until you type y. Any other answer stops it.
  • It copies by default and reads every copy back to compare it byte for byte. It never deletes a file.
  • A name already taken in a day folder gets a suffix (IMG_1-2.jpg). It never overwrites a file.
  • A file without a capture date takes the earlier of its creation and modification dates, and the plan lists it as by file date.
  • A Live Photo's HEIC and MOV and its AAE edit go into the same day folder.
  • A second run copies only what is new. Ctrl+C stops it cleanly: no half-copied file is left.
  • It sorts by date only. Files that are not photos or videos stay where they are.

Want a second copy you cannot lose?

The full Coldcopy copies camera cards to your drive and to S3 Glacier Deep Archive in your own AWS account, checks every copy byte for byte, catches duplicates by their content and checks the archive again on every run.

See the full Coldcopy