cleanup_crazy_temp_files
Differences
This shows you the differences between two versions of the page.
| cleanup_crazy_temp_files [2011/05/19 15:26] – created jt | cleanup_crazy_temp_files [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Cleanup crazy temp files ====== | ||
| - | <code perl> | ||
| - | |||
| - | #!/bin/env perl | ||
| - | # name: clean-magick-tmp | ||
| - | # date: 20110515 | ||
| - | # author: jason thomas < | ||
| - | # purpose: check tmp dir for pesky image magick tmp files that are larger then 3gb | ||
| - | |||
| - | use strict; | ||
| - | my $maxsize = ' | ||
| - | my $tmpdir = '/ | ||
| - | opendir (TMPDIR, $tmpdir); | ||
| - | my @tmpfiles = readdir(TMPDIR); | ||
| - | close (TMPDIR); | ||
| - | |||
| - | foreach (@tmpfiles){ | ||
| - | my $pathtotmp = " | ||
| - | if ($pathtotmp =~ m/ | ||
| - | |||
| - | if (-s $pathtotmp >= $maxsize){ | ||
| - | open (FH, "< | ||
| - | if(tell(FH) != -1){ | ||
| - | print " | ||
| - | unlink $pathtotmp; | ||
| - | |||
| - | } | ||
| - | } | ||
| - | } | ||
| - | } | ||
| - | |||
| - | </ | ||
cleanup_crazy_temp_files.1305818783.txt.gz · Last modified: 2020/08/10 02:28 (external edit)
