| ## Merging CDS Directories The following procedure merges the source directory /.:/eng into the target directory /.:/rnd: 1. Perform a skulk on the /.:/eng directory before merging it with the /.:/rnd directory. This synchronization of the source directory's replicas can prevent errors that cause the merge operation to fail. dcecp> directory synchronize /.:/eng dcecp> 2. Run the directory merge command to merge the /.:/eng and /.:/rnd directories: dcecp> directory merge /.:/eng -into /.:/rnd dcecp> Note that the directory merge command merges only the immediate contents of the source directory named in the command line argument (that is, the object entries, soft links, and child directories in these directories). To copy the descendants of any child directories of a directory to a target location, you must use the -tree option of the command. For example, if the /.:/eng directory in the previous example included the child directories dev and qa and you wanted to merge the contents of these directories into the target directory /.:/rnd, you would enter the command line: dcecp> directory merge /.:/eng -into /.:/rnd -tree dcecp> By default, the directory merge command places all object entries, soft links, and child directories in the target directory's master clearinghouse. You can, however, place child directories in another clearinghouse. To do this, you use the -clearinghouse option of the command to specify the name of the other clearinghouse. Note that you are allowed to specify only one alternate clearinghouse in the -clearinghouse option. If you wish to place child directories in different alternate clearinghouses, you must issue separate directory merge commands for each clearinghouse, or you must issue a single directory merge command to place all the child directories in one clearinghouse, then relocate the directories after the merge operation. Note: The CDS objects created by the directory merge command retain all of the writeable attribute values and some of the read-only attribute values of the source objects. However, these objects do not inherit the ACLs of the source objects. If the merged object is a directory, the directory merge command gives it the default ACLs of the initial container. If the merged object is any other CDS object type, the directory merge command gives it the default ACLs of the initial object. If the directory merge command encounters problems with the merge operation, it behaves in one of two ways. If you include the -nocheck option, the command does not check for errors before performing the operation. It proceeds immediately to perform the operation, and, if it encounters an error, stops. If you omit the -nocheck option, the command checks for certain error conditions before starting the merge. If it finds errors, it displays messages for the errors and stops, otherwise it proceeds with the merge. Error messages returned by the directory merge command identify the CDS entity causing the problem and provide a brief description of the problem. You should fix any problems that the command encounters, before running it again. (See Handling Errors for more information on the types of errors that can occur during a merge operation.) 3. After the merge operation, the /.:/eng directory (and its contents) still exists at the source location. Run the following commands to delete the /.:/eng directory from its original location and create a soft link named /.:/eng in place of the deleted directory. The soft link will redirect lookups of the obj1 and link1 object entries to their new locations in the /.:/rnd directory. It is recommended that you perform a skulk on a source directory before deleting it. This synchronization of the directory's replicas can prevent errors that cause the delete operation to fail. The sequence of commands to synchronize and delete the /.:/eng directory and then create soft links for the former contents are as follows: dcecp> directory synchronize /.:/eng dcecp> directory delete /.:/eng -tree dcecp> link create /.:/eng -to /.:/rnd dcecp> The directory delete command invoked with the -tree option deletes a directory and all the object entries, soft links, and child directories beneath that directory. If you use the directory delete command without the -tree option, all of the directories to be deleted must be empty, or errors will occur. The following figure shows the structure of the example namespace before and after the merge operation in our example. Example Namespace Before and After the Merge Operation More: Appending CDS Directories Modifying ACLs at the Target Location ###