|-c[I]||Controls when fastrm calls chdir(2). If the number of files to be unlinked from a given directory is at least I, then fastrm will change to that directory before unlinking those files. Otherwise, it will use either the absolute path names or a path name relative to the current directory (whichever is likely more efficient). The I parameter is optional; if just -c is given, -c1 is assumed, which will cause fastrm to always chdir before calling unlink(2). The default is -c3. Use -c0 to prevent fastrm from ever using chdir(2).|
|-d||Dont remove any files. Instead, print a list of the files that would be removed to standard output. Each line contains either the current directory of fastrm at the time it would do the unlink and the relative path name it would pass to unlink(2) as two fields separated by whitespace and a /, the absolute path name (as a single field) that would be passed to unlink(2), or the string Token and the storage API token that would be removed.|
|-e||Treat an empty input file as an error. This is most useful when fastrm is last in a pipeline after a preceding sort(1) command, ensuring that fastrm will fail if the sort fails.|
When -s is given and the number of files to remove in a directory is
greater than M, rather than remove files in the order given, fastrm
will open the directory and read it, unlinking files in the order that
they appear in the directory. On systems with a per-process directory
cache or that use a linear search to find files in a directory, this
should make directory lookups faster. The M parameter is optional; if
just -s is given, -s5 is assumed.
When this option is in effect, fastrm wont attempt to remove files that it doesnt see in the directory, possibly significantly speeding it up if most of the files to be removed have already been deleted. However, using this option requires fastrm to do more internal work and it also assumes that the order of directory listings is stable in the presence of calls to unlink(2) between calls to readdir(3). This may be a dangerous assumption with some sophisticated file systems (and in general this option is only useful with file systems that use unindexed linear searches to find files in directories or when most of the files to be removed have already been deleted).
This optimization is off by default.
Specifying this option promises that there are no symbolic links in the
directory tree from which files are being removed. This allows fastrm
to make an additional optimization to its calls to chdir(2), constructing
a relative path using ../.. and the like to pass to chdir(2) rather
than always using absolute paths. Since this reduces the number of
directory lookups needed with deeply nested directory structures (such as
that typically created by traditional news spool storage), it can be a
significant optimization, but it breaks horribly in the presence of
symbolic links to directories.
When -u is given, fastrm will use at most N levels of .. segments to construct paths. N is optional; if just -u is given, -u1 is assumed.
This optimization is off by default.
fastrm exits with a status of zero if there were no problems, and an exit status of 1 if something went wrong. Attempting to remove a file that does not exist is not considered a problem.
fastrm is typically invoked by INN via expirerm(8) using a command like:
fastrm -e <patharticles in inn.conf> < expire.list
To enable all optimizations and see the affect on the order of removal caused by -s, use:
fastrm -d -s -e -u <patharticles> < expire.list
If your file system has indexed directory lookups, but you have a deeply nested directory structure, you may want to use a set of flags like:
fastrm -e -u3 <patharticles> < expire.list
to strongly prefer relative paths but not to use readdir(2) to order the calls to unlink(2).
You may want to edit expirerm(8) to change the flags passed to fastrm.
fastrm cuts corners and does not worry about security, so it does not use chdir(2) safely and could be tricked into removing files other than those that were intended if run on a specially constructed file tree or a file tree that is being modified while it is running. It should therefore never be used with world-writable directories or any other directory that might be controlled or modified by an attacker.
fastrm defers opening the storage subsystem or attempting to parse any INN configuration files until it encounters a token in the list of files to remove. Its therefore possible to use fastrm outside of INN as a general fast file removal program.
fastrm was originally written by <firstname.lastname@example.org>. This manual page was rewritten in POD by Russ Allbery <email@example.com> for InterNetNews.
$Id: fastrm.pod 9767 2014-12-07 21:13:43Z iulius $
|INN 2.6.0||FASTRM (1)||2015-09-12|