Perforce 2005.1 System Administrator's Guide
<< Previous Chapter
Perforce Proxy
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Index

Appendix A
Perforce Server (p4d) Reference

Synopsis

Invoke the Perforce server or perform checkpoint/journaling (system administration) tasks.

Syntax

p4d [ options ]
p4d.exe [
options ]
p4s.exe [
options ]
p4d -j [ -z ] [
args ... ]

Description

The first three forms of the command invoke the Perforce background process ("Perforce server"). The fourth form of the command is used for system administration tasks.

On UNIX and MacOS X, the executable is p4d.

On Windows, the executable is p4d.exe (running as a server) or p4s.exe (running as a service).

Exit Status

After successful startup, p4d does not normally exit. It merely outputs the startup message

and runs in the background.

On failed startup, p4d returns a nonzero error code.

Also, if invoked with any of the -j checkpointing and/or journaling flags, p4d exits with a nonzero error code if any error occurs.

Options

Flag
Meaning

-d

Run as a daemon (in the background)

-f

Run as a single-threaded (non-forking) process

-i

Run from inetd on UNIX

-q

Run quietly (no startup messages)

-s

Run p4d.exe as an NT service (equivalent to running p4s.exe)

-xi

Irreversibly reconfigure the Perforce server (and its metadata) to operate in unicode mode. Do not use this flag unless you know you require unicode mode. See the Release Notes for details.

-xu

Run database upgrades and exit.

-c command

Lock database tables, run command, unlock the tables, and exit.

-jc [ prefix ]

Journal-create; checkpoint and save/truncate journal.

-jd [ file ]

Journal-checkpoint; create checkpoint without saving/truncating journal.

-jj [ prefix ]

Journal-only; save and truncate journal without checkpointing.

-jr file

Journal-restore; restore metadata from a checkpoint and/or journal file.

-z

Compress (in gzip format) checkpoints and journals.

-h, -?

Print help message.

-V

Print server version.

-J journal

Specify a journal file. Overrides P4JOURNAL setting. Default is journal.

-L log

Specify a log file. Overrides P4LOG setting. Default is stderr.

-p port

Specify a port to listen to. Overrides P4PORT. Default 1666.

-r root

Specify the server root directory. Overrides P4ROOT. Default is current working directory.

-v debuglevel

Set server trace flags. Overrides value P4DEBUG setting. Default is null.

Usage Notes

Related Commands

To start the server, listening to port 1999, with journaling enabled and written to journalfile.

p4d -d -p 1999 -J /opt/p4d/journalfile

To checkpoint a server with a non-default journal file, the -J argument (or the environment variable P4JOURNAL) must match the journal file specified when the server was started.

Checkpoint with:

p4d -J /p4d/jfile -jc

or

P4JOURNAL=/p4d/jfile ; export P4JOURNAL
p4d -jc

To create a compressed checkpoint from a server with files in directory P4ROOT

p4d -r $P4ROOT -z -jc

To create a compressed checkpoint with a user-specified prefix of "ckp" from a server with files in directory P4ROOT

p4d -r $P4ROOT -z -jc ckp

To restore metadata from a checkpoint named checkpoint.3 for a server with root directory P4ROOT

p4d -r $P4ROOT -jr checkpoint.3

To restore metadata from a compressed checkpoint named checkpoint.3.gz for a server with root directory P4ROOT

p4d -r $P4ROOT -z -jr checkpoint.3.gz


Perforce 2005.1 System Administrator's Guide
<< Previous Chapter
Perforce Proxy
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Index
Please send comments and questions about this manual to [email protected].
Copyright 1999-2005 Perforce Software. All rights reserved.
Last updated: 05/12/05