]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/vac
c63a77c7d3d2928f79ab759dd890152884c1fc25
[plan9front.git] / sys / man / 1 / vac
1 .TH VAC 1
2 .SH NAME
3 vac, unvac \- create, extract a vac archive on Venti
4 .SH SYNOPSIS
5 .B vac
6 [
7 .B -mqstv
8 ] [
9 .B -a
10 .I vacfile
11 ] [
12 .B -b
13 .I blocksize
14 ] [
15 .B -d
16 .I oldvacfile
17 ] [
18 .B -e
19 .I exclude
20 ] [
21 .B -f
22 .I vacfile
23 ] [
24 .B -i
25 .I name
26 ] [
27 .B -h
28 .I host
29 ] [
30 .B -x
31 .I excludefile
32 ]
33 .I file ...
34 .PP
35 .B unvac
36 [
37 .B -Tcdtv
38 ] [
39 .B -h
40 .I host
41 ]
42 .I vacfile
43 [
44 .I file ...
45 ]
46 .SH DESCRIPTION
47 .I Vac
48 creates an archival copy of Plan 9 file trees on Venti. It can be used
49 to build a simple backup system. One of the unusual properties of Venti is
50 that duplicate blocks are detected and coalesced.  When
51 .I vac
52 is used on a file tree that shares data with an existing archive, the consumption of
53 storage will be approximately equal to an incremental backup.
54 This reduction in storage consumption occurs transparently to the user.
55 .PP
56 As an optimization, the 
57 .B -d
58 and
59 .B -q
60 options, described below, can be used to explicitly create an archive relative to an existing archive.
61 These options do not change the resulting archive generated by
62 .IR vac ,
63 but simply reduce the number of write operations to Venti.
64 .PP
65 The output of
66 .I vac
67 is the hexadecimal representation of the SHA1 fingerprint of the root of the archive, in this format:
68 .IP
69 .EX
70 vac:64daefaecc4df4b5cb48a368b361ef56012a4f46
71 .EE
72 .PP
73 The options to 
74 .I vac
75 are:
76 .TF "-d\fI oldvacfile"
77 .PD
78 .TP
79 .BI -a " vacfile
80 Specifies that vac should create or update a backup archive, inserting
81 the files under an extra two levels of directory hierarchy named
82 .I yyyy/mmdd
83 (year, month, day)
84 in the style of the dump file system
85 (see Plan 9's \fIfs\fR(4)).
86 If
87 .I vacfile
88 already exists, an additional backup day is added to the
89 existing hierarchy, behaving as though the
90 .B -d
91 flag was specified giving the most recent backup tree in the archive.
92 Typically, this option
93 is used as part of a nightly backup script.
94 This option cannot be used with
95 .B -d
96 or
97 .BR -f .
98 .TP
99 .BI -b " blocksize
100 Specifies the block size that data will be broken into.
101 The units for the size can be specified by appending
102 .L k
103 to indicate kilobytes.
104 The default is 8k.
105 The size must be in the range
106 of 512 bytes to 52k.
107 .TP
108 .BI -d " oldvacfile
109 Reduce the number of blocks written to Venti by comparing the files to be stored with
110 the contents of an existing
111 .I vac
112 file tree whose score is stored in
113 .IR oldvacfile .
114 .TP
115 .BI -e " exclude
116 Do not include the file or directory specified by
117 .IR exclude .
118 This option may be repeated multiple times.
119 .I Exclude
120 can be a shell pattern as accepted by
121 .IR rc (1),
122 with one extension: 
123 .B \&...
124 matches any sequence of characters including slashes.
125 .TP
126 .BI -f " vacfile
127 The results of 
128 .I vac
129 are placed in
130 .IR vacfile ,
131 or the standard output if no file is given.
132 .TP
133 .BI -i " name
134 Include standard input as one of the input files, storing it in the archive
135 with the specified
136 .IR name .
137 .TP
138 .BI -h " host
139 The network address of the Venti server.
140 The default is taken from the environment variable
141 .BR venti .
142 If this variable does not exist, then the default is the
143 metaname 
144 .BR $venti ,
145 which can be configured via
146 .IR ndb (6).
147 .TP
148 .B -m
149 Expand and merge any
150 .I vac
151 archives that are found while reading the input files.  This option is
152 useful for building an archive from a collection of existing archives.  Each archive is inserted
153 into the new archive as if it had been unpacked in the directory in which it was found.  Multiple
154 archives can be unpacked in a single directory and the contents will be merged.  To be detected, the
155 archives must end in
156 .LR .vac .
157 Note, an archive is inserted by simply copying the root fingerprint and does not require
158 the archive to be unpacked.
159 .TP
160 .B -q
161 Increase the performance of the
162 .B -d
163 option by detecting unchanged files based on a match of the files name and other meta data,
164 rather than examining the contents of the files.
165 .TP
166 .B -s
167 Print out various statistics on standard error.
168 .TP
169 .B -t
170 Exclude files and directories with the temporary flag set.
171 .TP
172 .B -v
173 Produce more verbose output on standard error, including the name of the files added to the archive
174 and the vac archives that are expanded and merged.
175 .TP
176 .BI -x " excfile
177 Read exclude patterns from the file 
178 .IR excfile .
179 Blank lines and lines beginning with 
180 .B #
181 are ignored.
182 All other lines should be of the form
183 .B include
184 .I pattern
185 or
186 .B exclude
187 .I pattern .
188 When considering whether to include a directory or file
189 in the vac archive,
190 the earliest matching pattern in the file
191 applies.
192 The patterns are the same syntax accepted by the
193 .B -e
194 option.
195 This option may be repeated multiple times.
196 .PP
197 .I Unvac
198 lists or extracts files stored in the vac archive
199 .IR vacfile ,
200 which can be either a vac archive string in the format
201 given above or the name of a file containing one.
202 If
203 .I file
204 arguments are given, only those files or directories
205 will be extracted.
206 The options are:
207 .TP
208 .B -T
209 Set the modification time on extracted files
210 to the time listed in the archive.
211 .TP
212 .B -c
213 Write extracted files to standard output instead of creating a file.
214 .TP
215 .B -d
216 Reduce the number of blocks read from Venti by
217 comparing the files to be stored with their counterparts
218 in the file system.
219 This option cannot be used with
220 .BR -c .
221 .TP
222 .B -t
223 Print a list of the files to standard output rather than extracting them.
224 .TP
225 .B -v
226 If extracting files, print the name of each file and directory
227 to standard error.
228 If listing files, print metadata in addition to the names.
229 .TP
230 .B -h
231 as per
232 .IR vac .
233 .SH SOURCE
234 .B /sys/src/cmd/vac
235 .SH "SEE ALSO"
236 .IR vacfs (4),
237 .IR venti (8)