Added DownloadScheduler
[zeroinstall.git] / 0store.1
blob71e4357e91d4b0265df7400046fab8c33a1b885d
1 .TH 0STORE 1 "2010" "Thomas Leonard" ""
2 .SH NAME
3 0store \(em manage the implementation cache
5 .SH SYNOPSIS
7 .B 0store add
8 \fBDIGEST\fP \fBDIRECTORY\fP
10 .B 0store add
11 \fBDIGEST\fP \fBARCHIVE\fP [ \fBEXTRACT\fP ]
13 .B 0store audit
14 [ \fBDIRECTORY\fP ... ]
16 .B 0store copy
17 \fBDIRECTORY\fP [ \fBDIRECTORY\fP ]
19 .B 0store find
20 \fBDIGEST\fP
22 .B 0store list
24 .B 0store manifest
25 \fBDIRECTORY\fP [ \fBALGORITHM\fP ]
27 .B 0store optimise
28 [ \fBCACHE\fP ]
30 .B 0store verify
31 ( \fBDIGEST\fP | \fBDIRECTORY\fP )
33 .B 0store manage
35 .SH DESCRIPTION
36 .PP
37 0store provides access to the low-level implementation cache. Normally, the
38 cache is updated automatically using 0launch(1).
40 .SH ADD
41 .PP
42 To add a directory to the store (makes a copy):
44 .B 0store add sha256=XXX directory
46 .PP
47 To add an archive to the store:
49 .B 0store add sha256=XXX archive.tgz
51 .PP
52 To add a subdirectory of an archive to the store:
54 .B 0store add sha256=XXX archive.tgz subdir
56 .PP
57 The actual digest is calculated and compared to the given one. If they don't
58 match, the operation is rejected.
60 .SH AUDIT
61 .PP
62 Verifies every implementation in each of the given cache directories, or in all of the
63 default cache directories if no arguments are given. This will detect any packages which
64 have been tampered with since they were unpacked. If 0store itself could have been
65 modified by an attacker, mount the suspect file-system on a known-good machine and
66 run that machine's 0store on the mounted cache directory.
68 .PP
69 See the "verify" command below for details of the verification performed on each package.
71 .SH COPY
72 .PP
73 To copy an implementation (a directory with a name in the form
74 "algorithm=value"), use the copy function. This is similar to performing
75 a normal recursive directory copy followed by a
76 .B 0store verify
77 to check that the name matches the contents. E.g.:
79 .B 0store copy ~someuser/.cache/0install.net/implementations/sha256=XXX /var/cache/0install.net/implementations/
81 .SH FIND
82 .PP
83 To find the path of a stored item:
85 .B 0store find sha256=XXX
87 .SH LIST
89 .PP
90 See the list of implementation caches currently configured:
92 .B 0store list
94 To add directories to this list, add them to your 'implementation\-dirs'
95 configuration file.
97 .SH MANAGE
98 .PP
99 To open a window showing the contents of the cache:
101 .B 0store manage
103 You can use this to delete versions of programs you no longer need. However, this
104 doesn't remove any launchers you added (trying to launch the program will prompt
105 you to download the missing files again). For that, try:
107 .B 0desktop --manage
109 .SH MANIFEST
111 To generate the manifest for a directory structure:
113 .B 0store manifest DIRECTORY [ALGORITHM]
116 The manifest lists every file and directory in the tree, along with the
117 digest of each file, thus uniquely identifying that particular set of files.
118 After the manifest, the last line gives the digest of the manifest itself.
121 This value is needed when creating feed files. However, the 0publish
122 command will automatically calculate the required digest for you and add it
123 to a feed file. See the packager's guide on the Zero Install web site for
124 details.
126 Supported algorithms are 'sha1' (supported by all versions), 'sha1new'
127 (requires injector 0.20 or later) and 'sha256' (requires injector 0.20 or later
128 AND the Python hashlib module).
130 .SH OPTIMISE
132 To hard-link duplicate files together to save space:
134 .B 0store optimise [CACHE]
137 This reads in all the manifest files in the cache directory (~/.cache/0install.net/implementations
138 by default) and looks for duplicates (files with the same permissions, modification time and digest).
139 When it finds a pair, it deletes one and replaces it (atomically) with a hard-link to the other.
142 Implementations using the old 'sha1' algorithm are not optimised.
144 .SH VERIFY
146 To check that an item is stored correctly:
148 .B 0store verify /path/to/sha256=XXX
150 This calculates the manifest of the directory and checks that its digest matches
151 the directory's name. It also checks that it matches the digest of the .manifest
152 file inside the directory. If the .manifest doesn't correspond to the current
153 tree, it displays a list of the differences (in unified diff format).
155 .SH COMMAND-LINE OPTIONS
158 \fB\-h\fP, \fB\-\-help\fP
159 Show the built-in help text.
162 \fB\-v\fP, \fB\-\-verbose\fP
163 More verbose output. Use twice for even more verbose output.
166 \fB\-V\fP, \fB\-\-version\fP
167 Display version information.
169 .SH FILES
171 .IP "~/.cache/0install.net/implementations"
172 Cached implementations, indexed by manifest digest.
174 .IP "~/.config/0install.net/injector/implementation\-dirs"
175 List of system cache directories, one per line.
177 .SH LICENSE
179 Copyright (C) 2010 Thomas Leonard.
182 You may redistribute copies of this program under the terms of the GNU Lesser General Public License.
184 .SH BUGS
186 Please report bugs to the developer mailing list:
188 http://0install.net/support.html
190 .SH AUTHOR
192 The Zero Install Injector was created by Thomas Leonard.
194 .SH SEE ALSO
195 0alias(1), 0launch(1), 0store\-secure\-add(1)
197 The Zero Install web-site:
199 .B http://0install.net