Modes

The replication script runs in different modes defined by the action parameter passed to it.