util (metacp)
Synopsis
delete_subtree base_object
faddattr filename
fcreate filename
Purpose
Utilities for metacp.
Arguments
- base_object
-
The distinguished name of an entry in the DIT. See the String Representation for LDAP Binds chapter for a description of distinguished name syntax.
- filename
-
The name of the data file.
Operations
delete_subtree
Deletes the subtree under the specified base object. The base object itself is also deleted. This utility can only be performed for a default bind id. (See the obj bind operation for details.) The syntax is as follows:
delete_subtree base_object
Example
delete_subtree {ou=sales,o=pqr,c=de}
faddattr
Adds attributes and attribute values to existing entries in the DIT in batch mode. The syntax is as follows:
faddattr filename
where filename is a data file that contains the names and attributes of the entries in the following format:
-
Blank lines and lines starting with the # character are ignored.
-
All information for an entry must be contained in a single line. Each line is divided into fields separated by the SPACE character. If the SPACE character is part of an attribute, the field should be enclosed in curly braces ({ }).
-
The first field in a line contains the distinguished name of the entry and subsequent fields contain attribute information. If recurring values are specified for an attribute, the values must be separated by a semicolon (;) and the field must be enclosed in curly braces \{ }).
Here are some examples of the file format:
# Add description
{cn=Smith John,ou=sales,o=pqr,c=de} {description=Sales Manager}
# Add telephone number
cn=Mayer,ou=sales,o=pqr,c=de {telephoneNumber=+49(89)235-42356}
Example
faddattr datafile
fcreate
Creates entries in the DIT in a batch mode. The syntax is as follows:
fcreate filename
where filename is a data file that contains the names and attributes of the entries in the following format:
-
Blank lines and lines starting with the # character are ignored.
-
All information for an entry must be contained in a single line. Each line is divided into fields separated by the SPACE character. If the SPACE character is part of an attribute, the field should be enclosed in curly braces (\{ }).
-
The first field in a line contains the distinguished name of the entry and subsequent fields contain attribute information. If recurring values are specified for an attribute, the values must be separated by a semicolon (;) and the field must be enclosed in curly braces (\{ }).
Here are some examples of the file format:
# Organizational Unit
ou=Services,o=pqr,c=de objectClass=organizationalUnit
# Organizational Persons
{cn=Smith James,ou=Services,o=pqr,c=de} \
{objectClass=organizationalPerson;person;mhsUser} sn=Smith \
telephoneNumber=+49(89)123-456 {facsimileTelephoneNumber=+49(89)123-789} \
{postalAddress=Services Dpt$Einstein-Ring 4$D-81789 Munich,$Germany} \
{mhsOraddresses=/G=James/S=Smith/OU2=S41/OU1=MCH1/PRMD=PQR/ADMD=DBP/C=DE}
cn=Mayer,ou=services,o=pqr,c=de \
{objectClass=organizationalPerson;person;mhsUser} sn==Mayer \
telephoneNumber=+49(89)123-567 {facsimileTelephoneNumber=+49(89)123-789} \
{postalAddress =Services Dpt$Einstein-Ring 4$D-81789 Munich$Germany} \
{mhsOraddresses=/G=Erna/S=Mayer/OU2=S41/OU1=MCH1/PRMD=PQR/ADMD=DBP/C=DE}
cn=Richter,ou=services,o=pqr,c=de \
{objectClass=organizationalPerson;person;mhsUser} sn=Richter \
telephoneNumbe=+49(89)234-678 {facsimileTelephoneNumber=+49(89)234-6789} \
{postalAddress =Services Dpt$Albert-Ring 6$D-81789 Munich$Germany} \
{mhsOraddresses=/G=Franz/S=Richter/OU2=S12/OU1=MCH1/PRMD=PQR/ADMD=DBP/C=DE}
Example
fcreate datafile