1SHRINKFILE(1) General Commands Manual SHRINKFILE(1)
2
3
4
6 shrinkfile - shrink a file on a line boundary
7
9 shrinkfile [ -n ] [ -m maxsize ] [ -s size ] [ -v ] file...
10
12 The shrinkfile program shrinks files to a given size if the size is
13 larger than maxsize, preserving the data at the end of the file. Trun‐
14 cation is performed on line boundaries, where a line is a series of
15 bytes ending with a newline, ``\n''. There is no line length restric‐
16 tion and files may contain any binary data.
17
18 Temporary files are created in the <pathtmp in inn.conf> directory.
19 The ``TMPDIR'' environment variable may be used to specify a different
20 directory.
21
22 A newline will be added to any non-empty file that does not end with a
23 newline. The maximum file size will not be exceeded by this addition.
24
26 -s By default, size is assumed to be zero and files are truncated
27 to zero bytes. By default, maxsize is the same as size. If
28 maxsize is less than size, maxsize is reset to size. The ``-s''
29 flag may be used to change the truncation size. Because the
30 program truncates only on line boundaries, the final size may be
31 smaller then the specified truncation size. The size and max‐
32 size parameter may end with a ``k'', ``m'', or ``g'', indicating
33 kilobyte (1024), megabyte (1048576) or gigabyte (1073741824)
34 lengths. Uppercase letters are also allowed. The maximum file
35 size is 2147483647 bytes.
36
37 -v If the ``-v'' flag is used, then shrinkfile will print a status
38 line if a file was shrunk.
39
40 -n If the ``-n'' flag is used, then shrinkfile will exit 0 if any
41 file is larger than maxsize and exit 1 otherwise. No files will
42 be altered.
43
45 Example usage:
46
47 shrinkfile -s 4m curds
48 shrinkfile -s 1g -v whey
49 shrinkfile -s 500k -m 4m -v curds whey
50 if shrinkfile -n -s 100m whey; then echo whey is way too big; fi
51
53 Written by Landon Curt Noll <chongo@toad.com> and Rich $alz
54 <rsalz@uunet.uu.net> for InterNetNews.
55
57 inn.conf(5)
58
59
60
61 SHRINKFILE(1)