p4 replicate


Poll for journal changes on one Perforce server for forwarding to another Perforce server.


p4 replicate [-j token] [-s statefile] [-i interval] [-k -x -R] [-J prefix]
    [-T tables] [-o output] [command]


This command polls for new journal entries from a Perforce server, and either outputs them to standard output, or, if a command is specified, pipe the journal records to the command, which is spawned as a subprocess.


-j token

Specify a journal number or position token of the form journalnum/byteoffset from which to start replicating metadata. If this option is specified, it overrides any state file specification.

-s statefile

Specify a state file which tracks the most recent journal position. You can also use the statefile configurable to specify the state file.

-i interval

Specify a polling interval, in seconds. The default is two seconds. To disable polling (that is, to check once for updated journal entries and then exit), specify an interval of 0.

-J prefix

Specifies a filename prefix for the journal, such as that used with p4d -jc prefix

-T tables

Supply a list of database tables (for example, db.have) to exclude from export.


Keep the pipe to the command subprocess open between polling intervals.


Exit the p4 replicate command when journal rotation is detected.


The -R option causes p4 replicate to attempt reconnection to the server in the event of connection loss or serious error. A polling interval must be specified with -i interval.

-o savefile

Specify a file for output. If a command subprocess is specified, both the subprocess and the specified savefile are provided with the output.


See the “Global Options” section.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required




Related Commands

To update file content as well as journal records

p4 pull

To display journal or checkpoint records in raw form

p4 export