You can use scripts and utilities to automate all phases of synchronization:
Use scheduled jobs to automate the export and transport phases, and use receipt handlers or scheduled jobs to automate the import phase. You can run the scripts that are shipped with Rational ClearCase MultiSite at any time and with any frequency, and you can vary the strategy for different families by using multiple jobs.
By default, the synchronization scripts place packets and shipping orders in the incoming and outgoing directories in the default storage bay, ccase-home-dir/shipping/ms_ship (UNIX) or ccase-home-dir\var\shipping\ms_ship (Windows). This bay is defined in the shipping.conf template file on UNIX and the MultiSite Control Panel on Windows.
The scripts log their activity to files in the /var/adm/rational/clearcase/log/sync_logs directory on UNIX and the ccase-home-dir\var\log directory on Windows.
ClearCase installation adds three preconfigured jobs to the scheduler: Daily MultiSite Export, Daily MultiSite Shipping Poll, and Daily MultiSite Receive. These jobs use the predefined MultiSite tasks: MultiSite Sync Export and MultiSite Sync Receive.
These jobs are disabled; to enable them, use the schedule –edit –schedule command or the graphical interface (Windows) and set the run times and other parameters appropriately:
Job.Schedule.LastDate: StartDate
and set the value of Job.NotifyInfo.Recipients
to the appropriate user names.Note: If you decide to use receipt handlers (see Import Phase), you do not need to enable the Daily MultiSite Receive job.
For information about creating new tasks and jobs and the prerequisites for using the scheduler, see the schedule reference page in the Command Reference and the scheduler information in the Administrator’s Guide for Rational ClearCase.
The script sync_export_list creates update packets. You can select the replicas to be updated, configure the script to send the packets immediately or place them in storage bays, and set other shipping options. For more information about the shipping options, see the sync_export_list reference page.
This job runs sync_export_list to generate and send updates to all other replicas in the VOB family at midnight local time:
Job.Begin Job.Id: 17 Job.Name: "Sync Export Force ALL" Job.Description.Begin: Every midnight, for each replica on this host, export update packets to all sibling replicas. Job.Description.End: Job.Schedule.Daily.Frequency: 1 Job.Schedule.FirstStartTime: 00:00:00 Job.DeleteWhenCompleted: FALSE Job.Task: 13 Job.Args: -quiet 1 -all Job.End
To put the packets in a storage bay, use the –ship option. Packets in storage bays are sent by the shipping server. For example, this job runs sync_export_list to generate an update every day at 21:00 local time:
Job.Begin Job.Id: 18 Job.Name: "Sync Export Store ALL" Job.Description.Begin: Every night at 9PM, for each replica on this host, generate update packets for all sibling replicas and store the packets in the storage bay. Job.Description.End: Job.Schedule.Daily.Frequency: 1 Job.Schedule.FirstStartTime: 21:00:00 Job.DeleteWhenCompleted: FALSE Job.Task: 13 Job.Args: -quiet 1 -ship -all Job.End
For information about running shipping_server, see Transport Phase.
If sync_export_list or syncreplica puts packets in storage bays (–ship option), you must run shipping_server to process these packets. If you do not use –ship, but want to implement a retry-on-failure capability, you must schedule regular invocations of shipping_server. The shipping server attempts to retransmit any outgoing packets that remain in any of the storage bays because one or more previous attempts have failed.
With the –poll option, sync_export_list invokes shipping_server –poll to process shipping orders located in all storage bays defined in the shipping.conf file (UNIX) or in the MultiSite Control Panel (Windows).
For example, this job invokes shipping_server every day at 04:00 local time:
Job.Begin Job.Id: 19 Job.Name: "Shipping Server Poll" Job.Description.Begin: Every night at 4AM, run the shipping server to send any outstanding orders. Job.Description.End: Job.Schedule.Daily.Frequency: 1 Job.Schedule.FirstStartTime: 04:00:00 Job.DeleteWhenCompleted: FALSE Job.Task: 13 Job.Args: -quiet 1 -poll Job.End
The following job implements a more aggressive retry-on-failure capability. The shipping server is run every half hour from midnight to 04:00 local time:
Job.Begin Job.Id: 20 Job.Name: "Shipping Server Poll" Job.Description.Begin: Every half hour from midnight to 4AM, run the shipping server to send any outstanding orders. Job.Description.End: Job.Schedule.Daily.Frequency: 1 Job.Schedule.FirstStartTime: 00:00:00 Job.Schedule.StartTimeRestartFrequency: 00:30:00 Job.Schedule.LastStartTime: 04:00:00 Job.DeleteWhenCompleted: FALSE Job.Task: 13 Job.Args: -quiet 1 -poll Job.End
To automate packet import, use one of the methods described in Table 14.
You can define receipt handlers in the shipping.conf file for different shipping classes. By default, no receipt handler is defined, but you can specify the sync_receive script as a receipt handler in the shipping.conf file:
For details about defining receipt handler entries, see the section Receipt Handler in the shipping.conf reference page.
You can define receipt handlers in the MultiSite Control Panel for different shipping classes. By default, no receipt handler is defined, but you can specify ccase-home-dir\config\scheduler\tasks\sync_receive.bat in the MultiSite Control Panel. To customize sync_receive.bat, copy it to a directory outside the ClearCase installation directory, edit the copy, and specify it in the MultiSite Control Panel.
For details about defining receipt handler entries, see the section Receipt Handler Path in the MultiSite Control Panel reference page.
The script sync_receive imports update packets. For more information about the script’s options, see the sync_receive reference page.
This job runs sync_receive to import all packets in the incoming shipping bays of the current host at midnight local time: