GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SHRINKFILE(1) InterNetNews Documentation SHRINKFILE(1)

shrinkfile - Shrink files on line boundaries

shrinkfile [-nv] [-m maxsize] [-s size] file [file ...]

The shrinkfile program shrinks files to at most a given size when their 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 ("\n"). There is no line length restriction and files may contain any binary data.

If the first line is longer than the absolute value of size, the file will be truncated to zero length.

The maximum file size shrinkfile can handle is 2,147,483,647 bytes.

Temporary files are created in the pathtmp directory as set in inn.conf. 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, if naturally the resulting file size does not exceed size by this addition.

This program is currently used by only nntpsend(8).

-m maxsize
This option sets the maximum size allowed before truncation occurs.

By default, maxsize is the same as size (as set with the -s flag). If maxsize is less than size, maxsize is reset to size.

This parameter may end with a "k", "m" or "g", indicating kilobyte (1,024 bytes), megabyte (1,048,576 bytes) or gigabyte (1,073,741,824 bytes) lengths. Uppercase letters are also allowed.

-n
This flag is used to determine if any file is too large. No files will be altered in this mode.

Exits with status code 0 if any file is larger than maxsize (as set with the -m flag), and exits with status code 1 otherwise.

-s size
By default, size is assumed to be zero and files are truncated to zero bytes. This flag may be used to change the truncation size. Because the program truncates only on line boundaries, the final size may be smaller than the specified truncation size.

This parameter may end with a "k", "m" or "g", indicating kilobyte (1,024 bytes), megabyte (1,048,576 bytes) or gigabyte (1,073,741,824 bytes) lengths. Uppercase letters are also allowed.

-v
Prints to standard output a status line if a file was shrunk.

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

The first command shrinks curds to 4 MB if bigger than this size. The second command shrinks whey to 1 GB and outputs a log line if the file is bigger than this size. The third command shrinks both curds and whey to 500 kB if bigger than 4 MB, and outputs a log line for the files it has shrunk. The fourth command just prints a sentence if "whey" is bigger than 100 MB, without shrinking it.

Written by Landon Curt Noll <chongo@toad.com> and Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Rewritten into POD by Julien Elie.

nntpsend(8).
2021-11-20 INN 2.7.0

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.