Node Director
|
The copy command copies a set of records from one or more data sources into one data destination. During copy it can also process/convert the data set using merge and transform operations.
Copy can operate in different modes. However, this modes are less strictly separated than the paragraphs below seem to imply, by applying the options copy understands modes can be mixed.
When not specifying any further options all the source records from the data sources are collected and written to the destination database. Existing records are not overwritten.
With the -f option set existing records in the destination database are overwritten if the DN of a source record is identical with the DN of a destination record.
The -t option makes copy clear ("truncate") the destination database before copying the new records in. Thus, the destination database after copy with -t option set contains exactly the records copied in.
With the -m option set source records are rather merged than concatenated. This means that records with the same key (same DN) are combined together in order to form one single resulting record. This is usually used in order to combine multiple data sources that all have part of the data, like e.g. /etc/passwd and /etc/shadow.
In the merge mode copy also allows Transformers to be applied. Transform operations are requested by inserting an argument starting with a ':' followed by the name of a transformer. Optionally, the name of the transformer may be followed by another colon and a comma-separated list of options to pass to the transformer. Transform operations may be inserted between or after source database specifiers. They operate on the data set read so far.
Reads records in "host file" format from standard in and adds the resulting records into the hosts tree of the database. After this operation a host named somehost with IP address 1.2.3.4 and alias somealias will exist in the hosts database.
Reads records from /etc/passwd, /etc/shadow and /etc/samba/smbpasswd in the respective formats, merges the read records so that the resulting user objects contain the information from the three files and inserts the result into the people database. Note that this operation might well fail due to incomplete/partial records when the passwd, shadow and smbpasswd files are not completely in sync. Thus, the example translated into the real world would rather look like
Will read all user records from the people database, expand class information, translate the user records into automounter entries for an auto.home automounter map and finally write the records in automounter file format to /etc/auto.home.