chiark / gitweb /
Commit 2.4.5-5 as unpacked
[innduct.git] / doc / man / shrinkfile.1
1 .\" $Revision: 5909 $
2 .TH SHRINKFILE 1
3 .SH NAME
4 shrinkfile \- shrink a file on a line boundary
5 .SH SYNOPSIS
6 .B shrinkfile
7 [
8 .B \-n
9 ]
10 [
11 .BI \-m " maxsize"
12 ]
13 [
14 .BI \-s " size"
15 ]
16 [
17 .B \-v
18 ]
19 .I file...
20 .SH DESCRIPTION
21 The
22 .I shrinkfile
23 program shrinks files to a given 
24 .I size
25 if the size is larger than
26 .IR maxsize ,
27 preserving the data at the end of the file.
28 Truncation is performed on line boundaries, where a line is a series
29 of bytes ending with a newline, ``\en''.
30 There is no line length restriction and files may contain any binary data.
31 .PP
32 Temporary files are created in the
33 .I <pathtmp in inn.conf>
34 directory.
35 The ``TMPDIR'' environment variable may be used to specify a
36 different directory.
37 .PP
38 A newline will be added to any non-empty file that does not end with a newline.
39 The maximum file size will not be exceeded by this addition.
40 .SH OPTIONS
41 .TP
42 .B \-s
43 By default, 
44 .I size
45 is assumed to be zero and files are truncated to zero bytes.
46 By default,
47 .I maxsize
48 is the same as 
49 .IR size .
50 If
51 .I maxsize
52 is less than
53 .IR size ,
54 .I maxsize
55 is reset to
56 .IR size .
57 The ``\fB\-s\fP'' flag may be used to change the truncation size.
58 Because the program truncates only on line boundaries, the final size
59 may be smaller then the specified truncation size.
60 The
61 .I size
62 and
63 .I maxsize
64 parameter may end with a ``k'', ``m'', or ``g'', indicating
65 kilobyte (1024), megabyte (1048576) or gigabyte (1073741824) lengths.
66 Uppercase letters are also allowed.
67 The maximum file size is 2147483647 bytes.
68 .TP
69 .B \-v
70 If the ``\fB\-v\fP'' flag is used, then
71 .I shrinkfile
72 will print a status line if a file was shrunk.
73 .TP
74 .B \-n
75 If the ``\fB\-n\fP'' flag is used, then
76 .I shrinkfile
77 will exit 0 if any file is larger than
78 .I maxsize
79 and exit 1 otherwise.
80 No files will be altered.
81 .SH EXAMPLES
82 .PP
83 Example usage:
84 .sp 1
85 .RS
86 .nf
87 shrinkfile -s 4m curds
88 shrinkfile -s 1g -v whey
89 shrinkfile -s 500k -m 4m -v curds whey
90 if shrinkfile -n -s 100m whey; then echo whey is way too big; fi
91 .fi
92 .RE
93 .PP
94 .SH HISTORY
95 Written by Landon Curt Noll <chongo@toad.com> and Rich $alz
96 <rsalz@uunet.uu.net> for InterNetNews.
97 .de R$
98 This is revision \\$3, dated \\$4.
99 ..
100 .SH "SEE ALSO"
101 inn.conf(5)