in reply to Finding Temporary Files

While not a direct reply to your code, I have to comment on the process you're using.

I'm working on Unix ... I run a program that creates a report of suspect "temporary" files ... older than 2 years
—and e-mail it to the department to review

First, you are using the right tool - perl.

But, Unix/Linux is so much more stable than in the early years . . . and 80% can go to 100% in seconds.

My first use of perl was to purge temporary 'ftp' files that were left around in odd places. Waiting 2 years seems way too long.

I just took a look at a Unix email server that gets over 12 incoming emails per second (mostly spam), and our temporary filesystems never had more than 1000 temporary files at any one time. Looking at a Linux web server, it had a lot more temporary files, but expanded and contracted on activity.

( Note: This isn't to say that if we had hardware/software problems, things wouldn't change quickly! )

But the norm is purge temporary files immediately and then each morning at 03:44 every server runs a clean-up perl cron job to delete any temp files that were not deleted by the production software. All production software is recycled. This process usually takes less than 15 seconds.

The point I'm trying to make, is that you may be doing yourself and your organization a favor to identify code that is not cleaning up after itself. Your time is valuable to your organization, and I doubt that "department review" will do a better job than you in identifying true temporary files.

On the other hand, if you inherited this process, and management requires it to be done this way, then just . . .

Good Luck

"Well done is better than well said." - Benjamin Franklin

Replies are listed 'Best First'.
Re^2: Finding Temporary Files
by eff_i_g (Curate) on Jan 09, 2011 at 02:01 UTC
    flexvault,

    Understood and agreed.

    There are clean-up routines that are already in place and this is an addendum. This server is strictly internal so we do not encounter issues related to hosting, e-mail, spam, FTP, etc. However, we do run a plethora of programs and special applications. Unfortunately, in busy times dictated by "just get it done", not every process is written, ran, or tested to par.

    Most of the clean up is handled by other routines so if the box does reach the eightieth percentile it's at the point where humans must intervene because (1) there's old junk hanging around that cannot be dumped automatically (or isn't being found by the cleaner-uppers), or (2) our work has actually ballooned to the point where we truly need more space. Ergo, this program is aimed at aiding in that decision: remove, archive, and/or expand?