ltdbtool: add manpage
[obnox/ctdb.git] / doc / ltdbtool.1.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="ltdbtool.1">
4
5 <refmeta>
6         <refentrytitle>ltdbtool</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source"> </refmiscinfo>
9         <refmiscinfo class="manual"> </refmiscinfo>
10 </refmeta>
11
12
13 <refnamediv>
14         <refname>ltdbtool</refname>
15         <refpurpose>handle ctdb's local tdb copies </refpurpose>
16 </refnamediv>
17
18 <refsynopsisdiv>
19         <cmdsynopsis>
20                 <command>ltdbtool [OPTIONS] COMMAND</command>
21         </cmdsynopsis>
22 </refsynopsisdiv>
23
24   <refsect1><title>DESCRIPTION</title>
25     <para>
26       ltdbtool is a utility to cope with ctdb's local tdb copies (LTDBs)
27       without connecting to a ctdb daemon.
28     </para>
29     <para>It can be used to
30     <itemizedlist spacing='compact'> <!-- mark='opencircle' -->
31       <listitem>
32         <para>
33           dump the contents of a LTDB, optionally printing the ctdb
34           record header information,
35         </para>
36       </listitem>
37       <listitem>
38         <para>
39           convert between an LTDB and a non-clustered tdb
40           by adding or removing ctdb headers and
41         </para>
42       </listitem>
43       <listitem>
44         <para>convert between 64 and 32 bit LTDBs where the ctdb record
45         headers differ by 4 bytes of padding.
46         </para>
47       </listitem>
48     </itemizedlist>
49     </para>
50   </refsect1>
51
52   <refsect1><title>COMMANDS</title>
53
54     <variablelist>
55       <varlistentry><term>help</term>
56         <listitem>
57           <para>
58             Print a help text.
59           </para>
60         </listitem>
61       </varlistentry>
62       <varlistentry><term>dump &lt;IDB&gt;</term>
63         <listitem>
64           <para>
65             Dump the contents of a LTDB file to standard output in a
66             human-readable format.
67           </para>
68         </listitem>
69       </varlistentry>
70
71       <varlistentry><term>convert &lt;IDB&gt; &lt;ODB&gt;</term>
72         <listitem>
73           <para>
74             Make a copy of a LTDB optionally adding or removing ctdb headers.
75           </para>
76         </listitem>
77       </varlistentry>
78     </variablelist>
79   </refsect1>
80
81   <refsect1><title>OPTIONS</title>
82
83     <variablelist>
84       <varlistentry><term>-p</term>
85         <listitem>
86           <para>
87             Dump with header information, similar to "ctdb catdb".
88           </para>
89         </listitem>
90       </varlistentry>
91
92       <varlistentry><term>-s {0|32|64}</term>
93         <listitem>
94           <para>
95             Specify how to determine the ctdb record header size
96             for the input database:
97             <variablelist spacing="normal">
98               <varlistentry><term>0</term>
99               <listitem>
100                 <para>no ctdb header</para>
101               </listitem>
102               </varlistentry>
103               <varlistentry><term>32</term>
104               <listitem>
105                 <para>ctdb header size of a 32 bit system (20 bytes)</para>
106               </listitem>
107               </varlistentry>
108               <varlistentry><term>64</term>
109               <listitem>
110                 <para>ctdb header size of a 64 bit system (24 bytes)</para>
111               </listitem>
112               </varlistentry>
113             </variablelist>
114             The default is 32 or 64 depending on the system architecture.
115           </para>
116         </listitem>
117       </varlistentry>
118
119       <varlistentry><term>-o {0|32|64}</term>
120         <listitem>
121           <para>
122             Specify how to determine the ctdb record header size
123             for the output database, see -s
124           </para>
125         </listitem>
126       </varlistentry>
127
128       <varlistentry><term>-S &lt;SIZE&gt;</term>
129         <listitem>
130           <para>
131             Explicitly specify the ctdb record header size of the input database in bytes.
132           </para>
133         </listitem>
134       </varlistentry>
135
136       <varlistentry><term>-O &lt;SIZE&gt;</term>
137         <listitem>
138           <para>
139             Explicitly specify the ctdb record header size for the output database in bytes.
140           </para>
141         </listitem>
142       </varlistentry>
143
144       <varlistentry><term>-h</term>
145         <listitem>
146           <para>
147             Print a help text.
148           </para>
149         </listitem>
150       </varlistentry>
151     </variablelist>
152   </refsect1>
153
154   <refsect1><title>EXAMPLES</title>
155     <para>
156       Print a local tdb in "tdbdump" style:
157     </para>
158     <screen format="linespecific">
159       ltdbtool dump idmap2.tdb.0
160     </screen>
161
162     <para>
163       Print a local tdb with header information similar to "ctdb catdb":
164     </para>
165     <screen format="linespecific">
166       ltdbtool dump -p idmap2.tdb.0
167     </screen>
168
169     <para>
170       Strip the ctdb headers from records:
171     </para>
172     <screen format="linespecific">
173       ltdbtool convert -o0 idmap2.tdb.0 idmap.tdb
174     </screen>
175
176     <para>
177       Strip 64 bit ctdb headers from records, running on i386:
178     </para>
179     <screen format="linespecific">
180       ltdbtool convert -s64 -o0 idmap2.tdb.0 idmap.tdb
181     </screen>
182
183     <para>
184       Strip the ctdb headers from records by piping through tdbrestore:
185     </para>
186     <screen format="linespecific">
187       ltdbtool dump idmap2.tdb.0 | tdbrestore idmap.tdb
188     </screen>
189
190     <para>
191       Convert a local tdb from a 64 bit system for usage on a 32 bit system:
192     </para>
193     <screen format="linespecific">
194       ltdbtool convert -s64 -o32 idmap2.tdb.0 idmap2.tdb.1
195     </screen>
196
197     <para>
198       Add a default header:
199     </para>
200     <screen format="linespecific">
201       ltdbtool convert -s0 idmap.tdb idmap2.tdb.0
202     </screen>
203   </refsect1>
204
205   <refsect1><title>SEE ALSO</title>
206     <para>
207       ctdbd(1), ctdb(1), tdbdump(1), tdbrestore(1),
208       <ulink url="http://ctdb.samba.org/"/>
209     </para>
210   </refsect1>
211   <refsect1><title>COPYRIGHT/LICENSE</title>
212 <literallayout>
213 Copyright (C) Gregor Beck 2011
214 Copyright (C) Michael Adam 2011
215
216 This program is free software; you can redistribute it and/or modify
217 it under the terms of the GNU General Public License as published by
218 the Free Software Foundation; either version 3 of the License, or (at
219 your option) any later version.
220
221 This program is distributed in the hope that it will be useful, but
222 WITHOUT ANY WARRANTY; without even the implied warranty of
223 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
224 General Public License for more details.
225
226 You should have received a copy of the GNU General Public License
227 along with this program; if not, see http://www.gnu.org/licenses/.
228 </literallayout>
229   </refsect1>
230 </refentry>