.\" $Id: kruft.man,v 1.11 2012/02/29 18:45:36 ksb Exp $ .\" by Kevin Braunsdorf .\" $Compile: Display%h .\" $Display: ${groff-groff} -Tascii -man %f |${PAGER:-less} .\" $Display(*): ${groff-groff} -T%s -man %f .\" $Install: %b -mDeinstall %o %f && cp %f $DESTDIR/usr/local/man/man8/kruft.8 .\" $Deinstall: ${rm-rm} -f $DESTDIR/usr/local/man/[cm]a[nt]8/kruft.8* .TH KRUFT 8 LOCAL .SH NAME kruft - purge a filesytem of large and old files on demand .SH SYNOPSIS .ds PN "kruft \fI\*(PN\fP [\fB\-abcmnrsTv\fP] [\fB\-E\fP\~\fIexclude\fP] [\fB\-I\fP\~\fIpercent\fP] [\fB\-S\fP\~\fIpercent\fP] [\fIdirs\fP] .br \fI\*(PN\fP [\fB\-abcmnsrTv\fP] [\fB\-A\fP\~\fIoldest\fP] [\fB\-E\fP\~\fIexclude\fP] [\fIdirs\fP] .br \fI\*(PN\fP \fB\-h\fP .br \fI\*(PN\fP \fB\-V\fP .br .SH 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. .PP \fIKruft\fP is designed to clean out \fBpublic\fP FTP spools and the like (not your home directory, or /var/tmp). Casual use of this program from the command line is insane. .PP The goal of \fI\*(PN\fP is to make space on a public filesystem: it removes files until a space threshold is met, or under \fB\-A\fP until all files older than \fIoldest\fP are expunged. .SH OPTIONS If the program is called as \fI\*(PN\fP then no options are forced. .TP \fB\-a\fP | \fB\-m\fP | \fB\-c\fP | \fB\-b\fP | \fB\-r\fP Change which inode time to honor. The \fBb\fP denotes birthtime on FreeBSD systems (or others that support that). The \fBr\fP denotes the most recent of access, modify or change time. See \fBfind\fP(1). .TP \fB\-A\fP \fIoldest\fP Change the priority policy to ignore files newer than \fIoldest\fP seconds, and always remove files older than \fIoldest\fP. The number of seconds given may be suffixed by a scalar, use a parameter of question mark (``?'') for units help (see EXAMPLES below). .TP \fB\-E\fP \fIexclude\fP Any filenames listed in this colon (:) separated list are never removed. Things like ".profile" or "README" might be included to prevent their accidental removal. .TP \fB\-h\fP Print a brief help message. .TP \fB\-I\fP \fIpercent\fP Prune by number of files left on device. .TP \fB\-n\fP Do not execute commands, trace only. .TP \fB\-s\fP Force a sync of the filesystem after every delete. If you have softupdates installed on the partition \fBkruft\fP may delete all the files before softupdates frees the space from the first deletion. This option ``fixes'' that by forcing \fBkruft\fP to be synchronous (and slow). .TP \fB\-S\fP \fIpercent\fP Set the goal for this prune to be at most \fIpercent\fP space occupied on device. .TP \fB\-T\fP Truncate (rather then unlinking) targeted files. This is used to prevent open files from becoming unattached from the filesystem name-space while they continue to grow. .TP \fB\-v\fP Be verbose. Show actions as shell commands. .TP \fB\-V\fP Show \fBkruft\fP's version information. .SH EXAMPLES .TP kruft \-S50 \-I75 /usr/spool/uucppublic Clean \fI/usr/spool/uucppublic\fP to 50% space with at most 75% inodes used. .TP kruft \-S75 \-I80 /var/ftp/incoming Clean \fI/var/ftp/incoming\fP to at most 75% space and 80% inodes used. .TP 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. \fBXapply\fP runs 2 in parallel for us. .TP kruft \-r \-S80 /var/tmp Reduce \fI/var/tmp\fP such that the underlying filesystem is at most 80% full, using the most recent time on each file. .TP kruft \-A '?' \-V Display the siffix table for the \fIoldest\fP parameter, and the vesrion of \fI\*(PN\fP. .SH BUGS This sometimes \fBunlink\fPs open files, which doesn't do any good, but there is no \fBportable\fP way to see if a file is open. .PP The default options should hobble the command to prevent accidental shootings. .PP Defeating entombing in \fI\*(PN\fP is right on the fine line between clever and stupid. Assume that any file removed by \fI\*(PN\fP will never visit a tomb. .SH AUTHOR KS Braunsdorf .br UNIX Support .br kruft at ksb dot not-spam-please npcguild.org .SH "SEE ALSO" .hlm 0 sh(1), purge(8l), untmp(1l), unrm(1l), entomb(1l), xapply(1l), glob(1l)