Chapter 7: Copying Directory Structures with Ensync

7.1 About Ensync

[spacer]

Ensync is a wrapper for encp that allows you to copy the contents of an entire directory structure to Enstore via a single command. It is intended for uploading files to Enstore only, not downloading from it. Ensync makes a call to encp to handle each file transfer, and the transfers are done serially. The ensync program is intended for smaller experiments lacking the resources to create their own scripts to do this sort of thing, and without the high data volume of the large experiments.

Ensync works similarly to rsync -R in that it recursively copies files down a directory hierarchy, which encp cannot do. It behaves in much the same way that rcp does, but has more features and uses the rsync remote-update protocol to greatly speed up file transfers when the destination file already exists. It creates an area in PNFS namespace structurally similar to that from which the user is copying. It copies files/directories from a user’s local disk to this space. If a file already exists in Enstore with the same relative path/filename as one on the user’s disk, the user’s file does not get copied; the preexisting Enstore file stays as is.

7.2 Ensync Command Syntax

[spacer]

The command takes two arguments, the “from” and the “to” directories or files. The syntax is:

% ensync /<path_to>/.../<local_dir> /pnfs/.../<dest_dir>

There are no options to specify. A few notes:

• Symbolic links work if the target is under the same mount point as the link.

• Hard links are not kept. A new copy for each link would get two separate, identical files.

• Ensync tranfers one file at a time, it does not transfer them in parallel.