mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Mark Craig
30.49.2015 9e25366b81193070c5d1553b35481d8ddc52beab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ! CCPL HEADER START
  !
  ! This work is licensed under the Creative Commons
  ! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
  ! To view a copy of this license, visit
  ! http://creativecommons.org/licenses/by-nc-nd/3.0/
  ! or send a letter to Creative Commons, 444 Castro Street,
  ! Suite 900, Mountain View, California, 94041, USA.
  !
  ! You can also obtain a copy of the license at legal-notices/CC-BY-NC-ND.txt.
  ! See the License for the specific language governing permissions
  ! and limitations under the License.
  !
  ! If applicable, add the following below this CCPL HEADER, with the fields
  ! enclosed by brackets "[]" replaced with your own identifying information:
  !      Portions Copyright [yyyy] [name of copyright owner]
  !
  ! CCPL HEADER END
  !
  !      Copyright 2011-2015 ForgeRock AS.
  !
-->
<section xml:id="cli-overview"
         xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://docbook.org/ns/docbook
                             http://docbook.org/xml/5.0/xsd/docbook.xsd"
         xmlns:xlink="http://www.w3.org/1999/xlink">
 <title>Command-Line Tools</title>
 <indexterm><primary>Commands</primary></indexterm>
 
 <para>
  Before you try the examples in this guide,
  set your PATH to include the OpenDJ directory server tools.
  Where the tools are located depends on the operating environment
  and on the packages used to install OpenDJ.
  <xref linkend="cli-path-locations" /> indicates where to find the tools.
 </para>
 
 <table xml:id="cli-path-locations">
  <title>Paths To Administration Tools</title>
  <tgroup cols="3">
   <thead>
    <row>
     <entry>OpenDJ running on...</entry>
     <entry>OpenDJ installed from...</entry>
     <entry>Default path to tools...</entry>
    </row>
   </thead>
   <tbody>
    <row>
     <entry>Apple Mac OS X, Linux distributions, Oracle Solaris</entry>
     <entry>.zip</entry>
     <entry><filename>/path/to/opendj/bin</filename></entry>
    </row>
    <row>
     <entry>Linux distributions</entry>
     <entry>.deb, .rpm</entry>
     <entry><filename>/opt/opendj/bin</filename></entry>
    </row>
    <row>
     <entry>Microsoft Windows</entry>
     <entry>.zip</entry>
     <entry><filename>C:\path\to\opendj\bat</filename></entry>
    </row>
    <row>
     <entry>Oracle Solaris</entry>
     <entry>SVR4</entry>
     <entry><filename>/usr/opendj/bin</filename></entry>
    </row>
   </tbody>
  </tgroup>
 </table>
 
 <para>
  You find the installation and upgrade tools,
  <command>setup</command>,
  <command>upgrade</command>,
  and <command>uninstall</command>,
  in the parent directory of the other tools,
  as these tools are not used for everyday administration.
  For example, if the path to most tools is
  <filename>/path/to/opendj/bin</filename>
  you can find these tools in
  <filename>/path/to/opendj</filename>.
  For instructions on how to use the installation and upgrade tools, see the
  <link
   xlink:show="new"
   xlink:href="install-guide#install-guide"
   xlink:role="http://docbook.org/xlink/role/olink"
  ><citetitle>Installation Guide</citetitle></link>.
 </para>
 
 <para>
  All OpenDJ command-line tools take the <option>--help</option> option.
 </para>
 
 <para>
  All commands call Java programs and therefore involve starting a JVM.
 </para>
 
 <variablelist>
  <para>
   The following list uses the UNIX names for the commands.
   On Windows all command-line tools have the extension .bat.
  </para>
 
  <varlistentry>
   <term><link
    xlink:href="reference#backup-1"
    xlink:role="http://docbook.org/xlink/role/olink">backup</link></term>
   <listitem>
    <para>
     Backup or schedule backup of directory data.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#base64-1"
    xlink:role="http://docbook.org/xlink/role/olink">base64</link></term>
   <listitem>
    <para>
     Encode and decode data in base64 format.
    </para>
 
    <para>
     Base64 encoding represents binary data in ASCII,
     and can be used to encode character strings in LDIF, for example.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#create-rc-script-1"
    xlink:role="http://docbook.org/xlink/role/olink">create-rc-script</link>
   (UNIX)</term>
   <listitem>
    <para>
     Generate a script you can use to start, stop, and restart the server
     either directly or at system boot and shutdown.
     Use <command>create-rc-script -f <replaceable>script-file</replaceable></command>.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry condition="local-db">
   <term><link
    xlink:href="reference#dbtest-1"
    xlink:role="http://docbook.org/xlink/role/olink">dbtest</link></term>
   <listitem>
    <para>
     Debug databases for <literal>local-db</literal> backends.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#dsconfig-1"
    xlink:role="http://docbook.org/xlink/role/olink">dsconfig</link></term>
   <listitem>
    <para>
     The <command>dsconfig</command> command is the primary command-line tool
     for viewing and editing OpenDJ configuration.
     When started without arguments,
     <command>dsconfig</command> prompts you
     for administration connection information.
     Once connected it presents you with a menu-driven interface
     to the server configuration.
    </para>
 
    <para>
     When you pass connection information, subcommands,
     and additional options to <command>dsconfig</command>,
     the command runs in script mode and so is not interactive.
    </para>
 
    <para>
     You can prepare <command>dsconfig</command> batch scripts
     by running the command with the <option>--commandFilePath</option> option
     in interactive mode, then reading from the batch file
     with the <option>--batchFilePath</option> option in script mode.
     Batch files can be useful
     when you have many <command>dsconfig</command> commands to run
     and want to avoid starting the JVM and setting up a new connection
     for each command.
    </para>
 
    <para>
     Alternatively, you can read commands from standard input
     by using the <option>--batch</option> option.
    </para>
 
    <para>
     The <citetitle>Reference</citetitle> pages for the
     <link
      xlink:href="reference#dsconfig-1"
      xlink:role="http://docbook.org/xlink/role/olink"
      xlink:show="new"
     >dsconfig</link> command cover subcommands and configuration properties.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#dsjavaproperties-1"
    xlink:role="http://docbook.org/xlink/role/olink">dsjavaproperties</link></term>
   <listitem>
    <para>
     Apply changes you make to
     <filename>opendj/config/java.properties</filename>,
     which sets Java runtime options.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#dsreplication-1"
    xlink:role="http://docbook.org/xlink/role/olink">dsreplication</link></term>
   <listitem>
    <para>
     Configure data replication between directory servers
     to keep their contents in sync.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#encode-password-1"
    xlink:role="http://docbook.org/xlink/role/olink">encode-password</link></term>
   <listitem>
    <para>
     Encode a clear text password according to one of the available storage schemes.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#export-ldif-1"
    xlink:role="http://docbook.org/xlink/role/olink">export-ldif</link></term>
   <listitem>
    <para>
     Export directory data to LDAP Data Interchange Format,
     a standard, portable, text-based representation of directory content.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#import-ldif-1"
    xlink:role="http://docbook.org/xlink/role/olink">import-ldif</link></term>
   <listitem>
    <para>
     Load LDIF content into the directory, overwriting existing data.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldapcompare-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldapcompare</link></term>
   <listitem>
    <para>
     Compare the attribute values you specify with those
     stored on entries in the directory.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldapdelete-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldapdelete</link></term>
   <listitem>
    <para>
     Delete one entry or an entire branch of subordinate entries in the directory.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldapmodify-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldapmodify</link></term>
   <listitem>
    <para>
     Modify the specified attribute values for the specified entries.
    </para>
    <para>
     Use the <command>ldapmodify</command> command
     with the <option>-a</option> option to add new entries.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldappasswordmodify-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldappasswordmodify</link></term>
   <listitem>
    <para>
     Modify user passwords.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldapsearch-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldapsearch</link></term>
   <listitem>
    <para>
     Search a branch of directory data for entries
     that match the LDAP filter you specify.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldif-diff-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldif-diff</link></term>
   <listitem>
    <para>
     Display differences between two LDIF files,
     with the resulting output having LDIF format.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldifmodify-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldifmodify</link></term>
   <listitem>
    <para>
     Similar to the <command>ldapmodify</command> command,
     modify specified attribute values for specified entries in an LDIF file.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#ldifsearch-1"
    xlink:role="http://docbook.org/xlink/role/olink">ldifsearch</link></term>
   <listitem>
    <para>
     Similar to the <command>ldapsearch</command> command,
     search a branch of data in LDIF for entries matching the LDAP filter you specify.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#list-backends-1"
    xlink:role="http://docbook.org/xlink/role/olink">list-backends</link></term>
   <listitem>
    <para>
     List backends and base DNs served by OpenDJ directory server.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><link
    xlink:href="reference#make-ldif-1"
    xlink:role="http://docbook.org/xlink/role/olink">make-ldif</link></term>
   <listitem>
    <para>
     Generate directory data in LDIF,
     based on templates that define how the data should appear.
    </para>
 
    <para>
     The <command>make-ldif</command> command is designed
     to help generate test data that mimics data expected in production,
     but without compromising real, potentially private information.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#manage-account-1"
    xlink:role="http://docbook.org/xlink/role/olink">manage-account</link></term>
   <listitem>
    <para>
     Lock and unlock user accounts,
     and view and manipulate password policy state information.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#manage-tasks-1"
    xlink:role="http://docbook.org/xlink/role/olink">manage-tasks</link></term>
   <listitem>
    <para>
     View information about tasks scheduled to run in the server,
     and cancel specified tasks.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#rebuild-index-1"
    xlink:role="http://docbook.org/xlink/role/olink">rebuild-index</link></term>
   <listitem>
    <para>
     Rebuild an index stored in an indexed backend.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#restore-1"
    xlink:role="http://docbook.org/xlink/role/olink">restore</link></term>
   <listitem>
    <para>
     Restore user data from backup.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#start-ds-1"
    xlink:role="http://docbook.org/xlink/role/olink">start-ds</link></term>
   <listitem>
    <para>
     Start OpenDJ directory server.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#status-1"
    xlink:role="http://docbook.org/xlink/role/olink">status</link></term>
   <listitem>
    <para>
     Display information about the server.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#stop-ds-1"
    xlink:role="http://docbook.org/xlink/role/olink">stop-ds</link></term>
   <listitem>
    <para>
     Stop OpenDJ directory server.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#verify-index-1"
    xlink:role="http://docbook.org/xlink/role/olink">verify-index</link></term>
   <listitem>
    <para>
     Verify that an index stored in an indexed backend is not corrupt.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry>
   <term><link
    xlink:href="reference#windows-service"
    xlink:role="http://docbook.org/xlink/role/olink">windows-service</link>
   (Windows only)</term>
   <listitem>
    <para>
     Register OpenDJ as a Windows Service.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</section>