More About Replication Target Directories

In the previous replication example, source directory /stornext/snfs1/photos on host1 was replicated to target directory /stornext/backup/photos on host2. If the number of copies to keep is more than 1, the previous replication directories are named /stornext/backup/photos.1, /stornext/backup/photos.2, etc. The default name on the target is the same pathname relative to the file system mount point as the source directory name is relative to the source file system mount point.

Examples

Suppose you apply a replication policy to directory /stornext/snfs1/a/b/c/d/photos in file system /stornext/snfs1, and replicate to file system /stornext/backup. The default target replication directory name would be /stornext/backup/a/b/c/d/photos, and previous replication directories would be stornext/backup/a/b/c/d/photos.1, etc.

There are other options that can be specified on either the source policy or on the target policy. Since we have been concentrating on the source policy, following are examples of changes there.

When creating or editing a policy, specify the alternative path names in the area of the screen labeled Pathname on Target on the Outbound Replication tab. When you click the Override label, a field appears where you can type some text. Some hints appear above that field, showing special entry values such as %P and %D.

In all of the following examples, assume that the replication source directory is /stornext/snfs/photos/ocean in directory photos/ocean relative to the source file system /stornext/snfs1. For this example we will replicate to file system /stornext/backup. We know that if we do not override the "Pathname on Target" value, the replication target directory name will be /stornext/backup/photos/ocean.

  • If you enter a string without any of the "%" formatting characters, the replication directory will be the name you specify. For example, if you specify open/sesame for Pathname on Target, the replication directory would be /stornext/backup/open/sesame.
  • %P means source pathname relative to the source file system. For example, if you specify open/sesame/%P for Pathname on Target, the replication directory would be /stornext/backup/open/sesame/photos/ocean
  • %D means today’s date. %T means the replication time. For example, if you specify %D/%T/%P for Pathname on Target, the replication directory would be /stornext/backup/2010-02-02/16_30_22/photos/ocean (on February 2, 2010).
  • %H means source hostname. This would be a good value to use when more than one source machine is replicating files to the same target machine and target file system.

There are a lot of ways the "%" characters, and name specifications can be combined.

Note two important facts:

  • It is possible to generate target name collisions by specifying the same Pathname on Target for more than one policy. For example, you might choose "daily" for Pathname on Target in two source replication policies. In that case the first policy to replicate would succeed, and the second would fail due to the name collision. Using %H, %P, etc. can help you avoid these collisions.
  • Specifying a Pathname on Target is required if you want to replicate into a Storage Manager relation point. This will be discussed further in another section.