Timestamps in filenames save post-mortems
Every failed post-mortem I have sat through had the same scene in it: someone opens a directory of exports named dump.sql, dump-old.sql, dump-final.sql, and the room realizes nobody knows which file predates or postdates the incident. The data was there the whole time. The ordering was not.
Why the filename is the record
File modification timestamps are fragile. Copy a file to a laptop and the mtime can reset. Unpack an archive and contents get fresh dates. Git records commits, not the moment a generated artifact was actually written. The only timestamp that reliably travels with a file is the one baked into its name, and it costs about twenty characters.
The format that survives everything, including sorting in any file manager, is ISO 8601 in local-or-UTC with no spaces:
backup-2026-09-26T0312Z.sql
Zero-padded numbers sort lexicographically, which means ls order is chronological order with no scripting at all. This is the same trick that makes unix timestamp conversion useful in logs: when everything is sortable and readable in one glance, you stop converting dates by hand during an incident.
Where this pays off
- Database dumps and config snapshots before risky migrations. The filename is the rollback checklist.
- Generated reports sent to other people. Recipients see the date in the download list without opening properties.
- Log archives.
app-2026-09-26.logrotates cleanly, and grep across a date range becomes a filename glob instead of a parsing exercise.
One habit separates the amateurs from everyone else here: decide whether the name is UTC or local, and write the choice into the format. T0312Z is unambiguous. T0312 starts a fight between two servers in different timezones, and the timezone converter should not have to referee a naming argument during an outage.
Nothing about this is clever, which is the point. Twenty characters in a filename is the cheapest insurance against the most common failure in incident response: having the right file and no way to prove it.