This is the post the whole series turns on. Everything before it is the problem; everything after it is possible because of the idea here.
For two years I couldn’t sort my daughter’s photos. Not because there were too many — because I was trying to do it in the wrong place: inside the backup folder itself.
Why Sorting Inside a Backup Is a Trap
My phone auto-backs up to a folder on my NAS. My wife’s phone backs up to another. Those folders are my only copies of my daughter’s baby years. Naturally, I wanted to open them and pick out her best moments.
But the moment you try, you hit three walls at once:
- You can’t delete anything. To sort, you separate the keepers from the rest. But “the rest” here are my only copies of everything else. Deleting from a backup is deleting for real.
- The sync keeps moving under you. Synology Drive is still syncing that folder. Files appear, get reorganized, and shift while you work. You’re sorting on a floor that keeps tilting.
- You can’t tell new from old. After the first pass, hundreds of new files arrive next week — mixed right in with the thousands you already looked at. There’s no line between “done” and “new.”
The Idea: A Cutting Board
You don’t chop vegetables on the kitchen counter. You put a cutting board on the counter, cut on the board, and throw away the scraps. The counter stays clean.
The fix was exactly that. Add a working folder — a cutting board — that sits outside the backup:
- A = Dad’s phone backup (never touched)
- B = Mom’s phone backup (never touched)
- W = the working folder — the cutting board
- R = a small record of what’s been handled
- D = the final growth-record archive the app plays from
New files get copied from A and B onto W. All the messy sorting happens on W. The backups (A, B) are never opened for editing again. And a tiny ledger (R) remembers what’s already been dealt with, so the same file never comes back to haunt me.
How the Ledger (R) Keeps It Sane
The whole thing works because of one humble text record. When a file is copied from a backup onto the cutting board, R writes down:
- Which phone it came from (A or B)
- That it’s been copied (so it’s never copied twice)
And when a file finally moves into the archive (D), R marks it transferred — and it’s removed from the cutting board. Files I look at but decide not to keep get marked too (excluded), so they don’t drift back onto the board next hour.
That gives the automatic part a simple rule: when new files show up, copy only the ones that aren’t already on the board and aren’t already in R. No database, no fancy index — just “have I dealt with this file before? then skip it.” A duplicate can never sneak back in, and a reject never nags me twice.
💬 Prompt that worked “Write a script that copies files newer than a fixed date from two backup folders (A and B) into a separate working folder (W). Skip any file already in W, and skip any file listed in a processing record (R). Record which source folder each file came from. Modify the picker to work on W, not on A/B. Run the copy automatically once an hour, and also add a ‘check now’ button. When a file is moved to the final archive, delete it from W and mark it transferred in R. After I select some files, don’t say ’nothing left to process’ — just show the unselected files again so I can keep going. When I press ‘done,’ delete the unselected files from W. Does this logic hold together?”
That prompt took me three days to write. Not three days of typing — three days of thinking about what the system should actually do until I could say it in one plain paragraph. The code was the easy part once the sentence was right.
🗂 Claude.md Rule Never sort, move, or delete inside a backup folder. Copy new files to a disposable working folder first, sort there, and keep a small ledger of what’s been handled so nothing is processed twice.
Why This Is the Real Lesson
The satisfying part isn’t the Python. It’s that a two-year deadlock broke the moment I stopped guarding the backup with every click.
If you’ve ever frozen over a folder of irreplaceable files, afraid that sorting means losing something — this is the whole trick. Don’t work on the original. Put down a cutting board. Keep a note of what you’ve handled. Let the backup just be a backup.
The next posts show each piece in detail: the hourly check that feeds the board, the browser gallery I sort with, and the one button that shrinks a video and files it by month.
(Folder names above are simplified. My daughter’s face is blurred in every screenshot.)