I'm wondering if there is a proper way (or just best practice) to using temp files and the /tmp directory.
Background story:
In a script I had been using mktemp to create temp files in /tmp.
Needless to say that after running this script for a while, it filled /tmp and my HDD with these files. I didn't realize that i needed to do house cleaning of /tmp.
So now I'm curious as to how to properly use temp files and how to not abuse /tmp.
I suppose some of my shortcomings arise from the fact that I somehow had the crazy idea that /tmp was policed by the system and cleaned out when necessary.
I assume that I'll just need to self police and use my temp files more intelligently and get rid of them when I'm done with them instead of letting them clutter up /tmp.
Is this all I need to look out for or am I missing something?
Bookmarks