| 1 | .TH CLEANTMP 8
|
|---|
| 2 | .SH NAME
|
|---|
| 3 | cleantmp \- clean out a tmp dir
|
|---|
| 4 | .SH SYNOPSIS
|
|---|
| 5 | .B cleantmp
|
|---|
| 6 | .RB [ \-d "[\fIlevel\fR]]"
|
|---|
| 7 | .RB [ \-i
|
|---|
| 8 | .IR file "] ..."
|
|---|
| 9 | .BR \-\fIdays\fB | \-f
|
|---|
| 10 | .RI [ directory " ...]"
|
|---|
| 11 | .SH DESCRIPTION
|
|---|
| 12 | .B Cleantmp
|
|---|
| 13 | removes all files in each of the given directories and their subdirectories
|
|---|
| 14 | that have not been accessed for at least
|
|---|
| 15 | .I 'days'
|
|---|
| 16 | days. Empty subdirectories are removed if their modified times are more
|
|---|
| 17 | than
|
|---|
| 18 | .I 'days'
|
|---|
| 19 | days old.
|
|---|
| 20 | .B Cleantmp
|
|---|
| 21 | looks at days as humans do, i.e. they last from midnight to midnight.
|
|---|
| 22 | Meaning that
|
|---|
| 23 | .B cleantmp -1 /tmp
|
|---|
| 24 | removes all files that were not touched after midnight last night. This may
|
|---|
| 25 | be very helpful, because in many cases that big file that clogs up
|
|---|
| 26 | .B /tmp
|
|---|
| 27 | was created yesterday, but less than 24 hours ago.
|
|---|
| 28 | .PP
|
|---|
| 29 | The 'days' flag may be replaced by
|
|---|
| 30 | .B \-f
|
|---|
| 31 | causing
|
|---|
| 32 | .B cleantmp
|
|---|
| 33 | to remove all files in the directory no matter what age. Specifying zero
|
|---|
| 34 | days doesn't work, because it is assumed to be a mistake.
|
|---|
| 35 | .PP
|
|---|
| 36 | .B Cleantmp
|
|---|
| 37 | knows that files and directories that have a name starting with a '.' are
|
|---|
| 38 | special and will not delete them or files within them if they are not at
|
|---|
| 39 | least 14 days old.
|
|---|
| 40 | .SH OPTIONS
|
|---|
| 41 | .TP 5
|
|---|
| 42 | .BR \-d "[\fIlevel\fR]]"
|
|---|
| 43 | Set the debug level to
|
|---|
| 44 | .I level
|
|---|
| 45 | (by default 1). Normally only errors are reported. Debug level 1 lists the
|
|---|
| 46 | actions taken on standard error, level 2 also prints the file times used,
|
|---|
| 47 | and level 3 makes
|
|---|
| 48 | .B cleantmp
|
|---|
| 49 | playact, i.e. nothing is really removed.
|
|---|
| 50 | .TP
|
|---|
| 51 | .BI \-i " file "
|
|---|
| 52 | One or more
|
|---|
| 53 | .B \-i
|
|---|
| 54 | options name files to be ignored. Files are not removed if they are in the
|
|---|
| 55 | list of ignored files by either a directory entry match, or a full pathname
|
|---|
| 56 | match. This option is useful to keep things like named pipes that some
|
|---|
| 57 | longlived programs foolishly put in temporary directories.
|
|---|
| 58 | .SH "SEE ALSO"
|
|---|
| 59 | .BR find (1).
|
|---|
| 60 | .SH BUGS
|
|---|
| 61 | Don't use '\fBcleantmp -1\fP' shortly after midnight.
|
|---|
| 62 | .PP
|
|---|
| 63 | It would be nice if one could delete files that are, say, 2 hours old.
|
|---|
| 64 | .SH AUTHOR
|
|---|
| 65 | Kees J. Bot (kjb@cs.vu.nl)
|
|---|