Synchronizing Directories

Hopper can perform rsync-style directory synchronization operations. For example, suppose we want to synchronize from directory DirA on host HostA to directory DirB on host HostB. There are several ways to do this, but for clarity we will show you the most straightforward way. First, open directory windows for both HostA and HostB. Select DirA on HostA and drag it atop the directory icon or name for DirB on HostB. From the resulting pop-up menu, choose Synchronize this Directory.

Once a synchronization operation is underway, it is run in the background as a file transfer job. Use the Transfer Manager window to keep track of the synchronization job. As with any file transfer job, the Transfer Manager allows you to display a file transfer monitor window so you can view details of the transfer (and this is where you can view results of dry runs). A couple of points worth noting:

  • When syncing to HPSS, only the size and timestamp of a file will be used to determine if it needs updating — the actual content of the file is not examined.
  • The Create an exact mirror option can cause files on the sink to be deleted, which can be a disaster if the sink directory is chosen incorrectly. There are Dry run and Backup options available that can reduce this risk.

Note that the synchronize operation will use the Unix rsync command for synchronize operations between Unix hosts. Hopper becomes a simple-to-use interface for performing a variety of rsync operations. When one or both of the hosts involved with the sync operation are not Unix, or do not support rsync, built-in sync logic is used instead. This logic supports syncs using a wide variety of transfer protocols, including FTP, NFT, and SFTP.

Synchronize Dialog

Before a synchronization operation is actually invoked, a tabbed dialog is displayed that describes the operation and allows you to set various options. The initial tab describes the requested operation, including source and sink hosts and directories. The other tabs allow finer control over different aspects of the operation to be performed.

Description Tab

The Description tab describes the two hosts and directories involved with the synchronize operation. Pressing OK will cause the sync operation to begin.

Function Tab

The function tab provides the main control over how the sync operation will be performed. The default operation is to replace destination files that are "different" -- i.e., either in content, size, or timestamp. Many additional variations are possible, including ignoring timestamps when comparing files by looking at size only. One can also request that only pre-existing destination files be updated. Alternatively, one can request that pre-existing destination files be ignored, causing only missing files to be transferred.

Include/Exclude Tab

The Include/Exclude tab allows you to use wildcards to include or exclude patterns from the operation. In this example, we have excluded any files ending with a tilde, and all files named "core". One can use both include and exclude patterns in the same operation.

Window Tab

The Window tab modifies the timestamp comparison used by the sync operation. If the times on the source and sink systems are off from one another, the window operation expands the range of times that are considered identical. E.g., setting this to 10 means files within ten seconds of one another are considered to have the same timestamp.

Backup Tab

The Backup tab controls the generation of a backup directory on the sink host. This directory will contain backups of any sink files overwritten during the sync operation. Note that this can be slow and can use a lot of additional space. Note also that if you are uncertain what a particular sync operation will do, you can choose "Dry Run" on the Function tab to see what would happen without actually doing it.