sfidirector copy [-m] [-t] [-f] [-s subtree] [-d subtree] source1 [...] [:transform[:options]] destination
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.
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.
% sfidirector copy hostsfile:stdio: directory:Hosts 1.2.3.4 somehost somealias
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.
% sfidirector copy -m passwdfile:file:/etc/passwd \
shadowfile:file:/etc/shadow sambapasswdfile:file:/etc/samba/smbpasswd \
directory:People
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
% sfidirector copy -m -t passwdfile:file:/etc/passwd \
shadowfile:file:/etc/shadow sambapasswdfile:file:/etc/samba/smbpasswd \
ldiffile:file:/tmp/userrecords
% vi /tmp/userrecords # edit the records
% sfidirector copy ldiffile:file:/tmp/userrecords directory:People
% sfidirector copy -m -t directory:People :Config :AutoHome:Parent=/home \
automounterfile:file:/etc/auto.home
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.
1.4.5