KRUFT(8) KRUFT(8)
NAME
kruft - purge a filesystem of large and old files on demand
SYNOPSIS
kruft [-abcmnrsTv] [-E exclude] [-I percent] [-S percent] [dirs]
kruft [-abcmnsrTv] [-A oldest] [-E exclude] [dirs]
kruft -h
kruft -V
DESCRIPTION
Do not run this program if you are not sure you now what you are doing.
It will delete many, many files and it doesn't entomb anything.
Kruft is designed to clean out public FTP spools and the like (not your
home directory, or /var/tmp). Casual use of this program from the com-
mand line is insane.
The goal of kruft is to make space on a public filesystem: it removes
files until a space threshold is met, or under -A until all files older
than oldest are expunged.
OPTIONS
If the program is called as kruft then no options are forced.
-a | -m | -c | -b | -r
Change which inode time to honor. The b denotes birthtime on
FreeBSD systems (or others that support that). The r denotes
the most recent of access, modify or change time. See find(1).
-A oldest
Change the priority policy to ignore files newer than oldest
seconds, and always remove files older than oldest. The number
of seconds given may be suffixed by a scalar, use a parameter of
question mark (''?'') for units help (see EXAMPLES below).
-E exclude
Any filenames listed in this colon (:) separated list are never
removed. Things like ".profile" or "README" might be included
to prevent their accidental removal.
-h
Print only a brief help message.
-I percent
Prune by number of files left on device.
-n
Do not execute commands, trace only.
-s
Force a sync of the filesystem after every delete. If you have
softupdates installed on the partition, then kruft may delete
all the files before softupdates frees the space from the first
deletion. This option "fixes" that by forcing kruft to be syn-
chronous (and slow).
-S percent
Set the goal for this prune to be at most percent space occupied
on device.
-T
Truncate (rather then unlinking) targeted files. This is used
to prevent open files from becoming unattached from the filesys-
tem name-space while they continue to grow.
-v
Be verbose. Show actions as shell commands.
-V
Show only kruft's version information.
EXAMPLES
kruft -S50 -I75 /usr/spool/uucppublic
Clean /usr/spool/uucppublic to 50% space with at most 75% inodes
used.
kruft -S75 -I80 /var/ftp/incoming
Clean /var/ftp/incoming to at most 75% space and 80% inodes
used.
cd /var/unity && xapply -P2 'kruft -A 8h' olrb/[0-9][0-9]
Clean any file older than 8 hours from all the cache directories
under /var/unity/olrb whose name is 2 decimal digits. Note that
xapply(1l) runs 2 in parallel for us.
kruft -r -S80 /var/tmp
Reduce /var/tmp such that the underlying filesystem is at most
80% full, using the most recent time on each file.
kruft -A '?' -V
Display the suffix table for the oldest parameter, and the ver-
sion of kruft.
BUGS
This sometimes unlink(2)'s open files, which doesn't do any good, but
there is no portable way to see which files are presently open.
The default options should hobble the command to prevent accidental
shootings.
Defeating entombing in kruft is right on the fine line between clever
and stupid. Assume that any file removed by kruft will never visit a
tomb.
AUTHOR
KS Braunsdorf, NPCGuild.org UNIX Support
kruft at ksb dot not-spam-please npcguild.org
SEE ALSO
sh(1), purge(8l), untmp(1l), unrm(1l), entomb(7l), xapply(1l), glob(1l)
LOCAL KRUFT(8)
NAME |
SYNOPSIS |
DESCRIPTION |
OPTIONS |
EXAMPLES |
BUGS |
AUTHOR |
SEE ALSO