utility removes old files (and old empty directories) from the
specified directory. Itll be typically used to clean directories
such as /tmp where old files tend to accumulate.
utility never removes files or directories owned by root. It is a
feature, not a bug.
Great care is taken while descending into the directory, and the
operation is secure.
Anything thats not a directory, regular file, or symbolic link is
also left alone (because programs like
create sockets and FIFOs under /tmp and expect them to be long-lived;
we accomodate this practice).
Unlike floating around Perl scripts that do the same task
never forks and consumes limited amount of memory (these Perl scripts
easily turn into forking bombs when someone creates a lot a
directories under /tmp). If your system is attacked and the
attacker creates an extremely deep file hierarchy,
wont add to the problem by crashing your system trying to remove it.
But it wont help you in fighting the attack, either, because it
descends only to a limited depth (currently, 30 levels). If
determines a race condition itll log the situation (you can look for
the word RACE in log files) and exit with a failure.
will clean temporary directories for you fine when there are no
attacks, and, when there is an attack,
wont make the situation worse (in particular, it cannot be tricked
into removing files outside specified directories or consume unlimited
amount of resources).
The following option is available:
The time specification that follows the
flag specifies how old a file or a directory has to be before it will
be removed. It can be a string like 1w (one week) or 4d5h (four
days plus five hours) or 2m3s (two minutes plus three seconds). The
default is 3d (three days).
Be verbose: list each file deleted.
utility exits 0 on success, and >0 if an error occurs.
utility will typically be run nightly from
invokation should be placed into the file
In other versions of BSD it should go into the
In Linux, check if you have
and if not, you can just run it from cron; usually youd have to edit