Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

shrinkfile(1) [redhat man page]

SHRINKFILE(1)						      General Commands Manual						     SHRINKFILE(1)

NAME
shrinkfile - shrink a file on a line boundary SYNOPSIS
shrinkfile [ -n ] [ -m maxsize ] [ -s size ] [ -v ] file... DESCRIPTION
The shrinkfile program shrinks files to a given size if the size is larger than maxsize, preserving the data at the end of the file. Truncation is performed on line boundaries, where a line is a series of bytes ending with a newline, . There is no line length restriction and files may contain any binary data. Temporary files are created in the <pathtmp in inn.conf> directory. The ``TMPDIR'' environment variable may be used to specify a different directory. A newline will be added to any non-empty file that does not end with a newline. The maximum file size will not be exceeded by this addi- tion. OPTIONS
-s By default, size is assume to be zero and files are truncated to zero bytes. By default, maxsize is the same as size. If maxsize is less than size, maxsize is reset to size. The ``-s'' flag may be used to change the truncation size. Because the program trun- cates only on line boundaries, the final size may be smaller then the specified truncation size. The size and maxsize parameter may end with a ``k'', ``m'', or ``g'', indicating kilobyte (1024), megabyte (1048576) or gigabyte (1073741824) lengths. Uppercase let- ters are also allowed. The maximum file size is 2147483647 bytes. -v If the ``-v'' flag is used, then shrinkfile will print a status line if a file was shrunk. -n If the ``-n'' flag is used, then shrinkfile will exit 0 if any file is larger than maxsize and exit 1 otherwise. No files will be altered. EXAMPLES
Example usage: shrinkfile -s 4m curds shrinkfile -s 1g -v whey shrinkfile -s 500k -m 4m -v curds whey if shrinkfile -n -s 100m whey; then echo whey is way too big; fi HISTORY
Written by Landon Curt Noll <chongo@toad.com> and Rich $alz <rsalz@uunet.uu.net> for InterNetNews. SEE ALSO
inn.conf(5) SHRINKFILE(1)

Check Out this Related Man Page

BATCHER(8)						      System Manager's Manual							BATCHER(8)

NAME
batcher - article batching backend for InterNetNews SYNOPSIS
batcher [ -a arts ] [ -A total_arts ] [ -b size ] [ -B total_size ] [ -i string ] [ -N num_batches ] [ -p process ] [ -r ] [ -s separator ] [ -S alt_spool ] [ -v ] host [ input ] DESCRIPTION
Batcher reads uses a list of files to prepare news batches for the specified host. It is normally invoked by a script run out of cron(8) that uses shlock(1) to lock the host name, followed by a ctlinnd(8) command to flush the batchfile. Batcher reads the named input file, or standard input if no file is given. Relative pathnames are interpreted from the <pathoutgoing in inn.conf> directory. The input is taken as a set of lines. Blank lines and lines starting with a number sign (``#'') are ignored. All other lines should consist of one or two fields separated by a single space. The first field is the name of a file holding an article; if it is not an an absolute pathname it is taken relative to the news spool directory, <patharticles in inn.conf>. The second field, if present, specifies the size of the article in bytes. OPTIONS
-S The ``-S'' flag may be used to specify an alternate spool directory to use if the article is not found; this would normally be an NFS-mounted spool directory of a master server with longer expiration times. -r By default, the program sets its standard error to <pathlog in inn.conf>/errlog. To suppress this redirection, use the ``-r'' flag. -v Upon exit, batcher reports statistics via syslog(3). If the ``-v'' flag is used, they will also be printed on the standard output. -b Batcher collects the text of the named articles into batches. To limit the size of each batch, use the ``-b'' flag. The default size is 60 kilobytes. Using ``-b0'' allows unlimited batch sizes. -a To limit the number of articles in each batch, use the ``-a'' flag. The default is no limit. A new batch will be started when either the byte count or number of articles written exceeds the specified limits. -B To limit the total number of bytes written for all batches, use the ``-B'' flag. -A To limit the total number of articles that can be batched use the ``-A'' flag. -N To limit the total number of batches that should be created use the ``-N'' flag. In all three cases, the default is zero, which is taken to mean no limit. -i string A batch starts with an identifying line to specify the unpacking method to be used on the receiving end. When the ``-i'' flag is used, the initial string, string, followed by a newline, will be output at the start of every batch. The default is to have no ini- tial string. -s Each article starts with a separator line to indicate the size of the article. To specify the separator use the ``-s'' flag. This is a sprintf(3) format string which can have a single ``%ld'' parameter which will be given the size of the article. If the separa- tor is not empty, then the string and a newline will be output before every article. The default separator is ``#! rnews %ld''. -p By default, batches are written to standard output, which is not useful when more than one output batch is created. Use the ``-p'' flag to specify the shell command that should be created (via popen(3)) whenever a new batch is started. The process is a sprintf format string which can have a single ``%s'' parameter which will be given the host name. A common value is: ( echo '#! cunbatch' ; exec compress ) | uux - -r -z %s!rnews EXIT STATUS
If the input is exhausted, batcher will exit with a zero status. If any of the limits specified with the ``-B,'' ``-A,'' or ``-N'' flags is reached, or if there is an error writing the batch, then batcher will try to spool the input, copying it to a file. If there was no input filename, the standard input will be copied to <pathoutgoing in inn.conf>/host and the program will exit. If an input filename was given, a temporary file named input.bch (if input is an absolute pathname) or <pathoutgoing in inn.conf>/input.bch (if the filename does not begin with a slash) is created. Once the input is copied, batcher will try to rename this temporary file to be the name of the input file, and then exit. Upon receipt of an interrupt or termination signal, batcher will finish sending the current article, close the batch, and then rewrite the batchfile according as described in the previous paragraph. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.5.6.1, dated 2000/08/17. SEE ALSO
ctlinnd(8), inn.conf(5), newsfeeds(5), shlock(1). BATCHER(8)
Man Page