CLEANTMP(8)

NAME
cleantmp - clean out a tmp dir

SYNOPSIS
cleantmp [-d[level]] [-i file] ... -days|-f [directory ...]

DESCRIPTION
Cleantmp removes all files in each of the given directories and their subdirectories that have not been accessed for at least 'days' days. Empty subdirectories are removed if their modified times are more than 'days' days old. Cleantmp looks at days as humans do, i.e. they last from midnight to midnight. Meaning that cleantmp -1 /tmp removes all files that were not touched after midnight last night. This may be very helpful, because in many cases that big file that clogs up /tmp was created yesterday, but less than 24 hours ago.

The 'days' flag may be replaced by -f causing cleantmp to remove all files in the directory no matter what age. Specifying zero days doesn't work, because it is assumed to be a mistake.

Cleantmp knows that files and directories that have a name starting with a '.' are special and will not delete them or files within them if they are not at least 14 days old.

OPTIONS

-d[level]]
    Set the debug level to level (by default 1). Normally only errors are reported. Debug level 1 lists the actions taken on standard error, level 2 also prints the file times used, and level 3 makes cleantmp playact, i.e. nothing is really removed.

-i file
    One or more -i options name files to be ignored. Files are not removed if they are in the list of ignored files by either a directory entry match, or a full pathname match. This option is useful to keep things like named pipes that some longlived programs foolishly put in temporary directories.

SEE ALSO
find(1).

BUGS
Don't use 'cleantmp -1' shortly after midnight.

It would be nice if one could delete files that are, say, 2 hours old.

AUTHOR
Kees J. Bot (kjb@cs.vu.nl)