deleted(1)

NAME
deleted - garbage collector in directory for temporary files.

SYNOPSIS
deleted [-vh] [-t TimeToLive] [-n Nice] [-d Mask] [-f Mask] TmpDir

deleted [-qvh] TmpDir

DESCRIPTION
deleted is a garbage collector in directory for temporary files. It deletes any object in directory tree if it is old enough ( more then -t TimeToLive old).

Before delete of directory or regular file deleted try to apply an advisory lock on the object. If lock is successful, then object will be deleting, else age of object resets to zero and object will not be deleting.

Note, that deleting of any object from directory always change mtime of directory and resets age to zero, so emptied directory will be deleted not earlier than -t TimeToLive after be emptied.

The following options are available:

-t TimeToLive
    the age of objects have to be deleted. Obligatory parameter.

    The default age of directory is youngest of ctime and mtime. See -d for non default settings.

    The age of symlink is youngest of atime, ctime, mtime of the link ( if not changed by -f) and the age of object link points to.

    The default age of regular files and other objects is youngest of atime, ctime and mtime. See -f for non default settings.

    Any case following letters can be used in TimeToLive:

    S   seconds.

    M   minutes ( 60 seconds).

    H   hours (60 minutes).

    D   days (24 hours).

    W   weeks (7 days).

    Y   years (53 weeks).

    no letter
        seconds.

-n Nice
    priority as in nice(1)

-f [amc]*
    points to times used to evaluate age of files and other non directory objects

    a   use atime

    m   use mtime

    c   use ctime

    The default is -f amc

-d [amc]*
    points to times used to evaluate age of directory. Coding is the same as for -f. The default is -d mc

-q  do not delete anything, just query deleted running in TmpDir about its parameters.

-h  Short help.

-v  Increase verbosity. More -v's result in more information.

If started in directory with deleted already started then one of deleted dies and other works with last deleted parameters.

deleted does not detach yourself from terminal. Use mkinittmpdir(1) to launch deleted or detach it by shell command.

FILES
+deleted.pid=
    file in TmpDir directory to handle deleted parameters and inter deleted coordination.

EXAMPLES
The following is an example of a typical usage of the deleted command:
    deleted -t 2w3d43200 -n 10 ${TMPDIR} &
launch deleted with nice 10 and TimeToLive 2.5 weeks (2 weeks 3 days 43200 seconds). To query about deleted use:
    deleted -q ${TMPDIR}

SEE ALSO
FreeBSD PR bin/18275: proposed TMPDIR setting and mkinittmpdir http://links.ru/FreeBSD/mkinittmpdir/ mkinittmpdir(1), chroot(2), stat(2), nice(1).

HISTORY
deleted was written in 2000 for ports collection to work in companion with mkinittmpdir(1)

AUTHORS
Aleksandr A. Babaylov (aka @BABOLO) .@babolo.ru http://www.links.ru/~babolo/

BUGS
Man (text) originally written by man (human) with no active English. Do the better if can.

deleted do chroot(2) to TmpDir so symlinks with absolute path can point to invalid or no objects. This affects symlinks age estimation.

All parameters of deleted is affected by subsequent deleted execute. Parameters must not change if not explicitly declared. For example if deleted is launched by
    deleted -t 2w -n 10 ${TMPDIR} &
and subsequent
    deleted -t 3d ${TMPDIR}
execute change TimeToLive (as wished) and Nice (may be undesired).