Freeze the flour
The pantry moths didn't fly in your window. They came home in a bag you carried through the door.

What it is
Putting every bag of flour, grain, cornmeal, beans, dried fruit, birdseed and pet food into the freezer for three days before it goes on the shelf.
The numbers
- 0°F for 72 hours kills eggs and larvae. A week in a home freezer, to be safe, since home freezers run warmer than they claim.
- Alternative: ~130°F for 1–2 hours, spread thin. Harder to do evenly.
- Alternative: oxygen absorbers in sealed mylar — low oxygen kills all life stages, and it's a second reason to store grain that way.
- Stored-product insects largely stop developing below 50°F, which means a cold storeroom is pest control you already paid for.
Why it's here
Because this is the fact that explains the thing everybody finds baffling: a spotless kitchen gets pantry moths. Indianmeal moth and the weevils arrive as eggs already inside the product — the flour, the bulk beans, the chicken feed, the bag of birdseed in the corner. Cleaning the shelf does nothing about an infestation that came in sealed.
The automation angle
Temperature in the storeroom, read as pest control rather than spoilage control. A room drifting above 50°F in October is an invitation. And keep a dated log of what came in — when an outbreak shows up, the only question is *which bag*, and a log answers in a minute what guessing answers in a weekend.
The catch
Freezing kills what's in there; it does not make the container mouse-proof or moth-proof afterward. Put it into glass, metal, or gasketed food-grade plastic — cardboard and paper aren't containers, a larva walks through the fold. Rigid containers also limit any future outbreak to one jar instead of the whole shelf.