PreviousNext

directory merge

Copies the contents of one directory into another directory. The syntax is:

directory merge source_directory_name
-into destination_directory_name
[-clearinghouse clearinghouse_name] [-tree] [-nocheck]

Options

-tree
Copies the contents of child directories (as well as the child directories themselves) into the destination directory.

-into destination_directory_name
The argument to this required option specifies the name of the destination directory. The destination directory must exist.

-clearinghouse clearinghouse_name
Puts the new objects (the resulting merged directory) into a clearinghouse other than that of the destination directory.

-nocheck
Lets the directory merge operation proceed without checking first for object name collisions or ACL problems. Use this option to save time when you are sure problems do not exist.

Description
The directory merge operation copies the contents of one directory into another. The argument is the name of the source directory. This command takes a required -into option to specify the destination directory which must exist. For example, if /.:/a has two child objects /.:/a/b and /.:/a/c, then a directory merge /.:/a -into /.:/x would result (assuming no errors) in the following objects: /.:/x/b and /.:/x/c.

Normally only the immediate contents of the directory are merged. This means all objects, links, and directories, but not the contents of child directories. To merge these as well, use the -tree option.

By default, the new objects are placed in the destination directory's clearinghouse, and all children (no matter how many levels down) are placed in the same clearinghouse. To place any descendant directories in another clearinghouse, use the -clearinghouse option with a value. There can only be one clearinghouse specified for all directories involved in the merge operation. To specify more than one, either change this after the merge has happened, or use separate commands.

This command first checks for any collisions or ACL problems before beginning to merge any objects. If there are any problems encountered, an error is generated (not immediately, all objects are checked) and the names of all problem objects, links or directories are returned in a list. The administrator should then address these problems and rerun the merge command. If the -nocheck option is specified the check is not performed. This way time can be saved when trying a known non-problematic merge. This is not an atomic operation and other changes to the involved objects can cause problems. This command should be issued when others are not modifying the involved directories. Changing ACLs can be done to ensure this. If an error does occur during the actual merging process, it is generated and the operation aborts immediately.

The merge command actually re-creates the objects with the same writeable attributes of the source objects. This means that some read-only attributes change between the source and destination. For example, the creation timestamp attribute (CDS_CTS) changes.

The resulting merged directory inherits its ACLs from the destination directory's initial container or initial object ACL's. Consequently, the ACLs of the destination objects are likely to differ from the ACLs of the source objects.

Privileges Required
You must have r (read) and i (insert) permission to the destination directory.

Examples
The following command merges the directories but not the contents of the /.:/depts/phrenology directory into the /.:/depts/radiology directory.

dcecp> dir list /.:/depts/phrenology -simple
applications services staff users

dcecp> directory merge /.:/depts/phrenology -into /.:/depts/radiology

dcecp> dir list /.:/depts/radiology -simple
applications services staff users
dcecp>