[p4] Backup scripts?

Weintraub, David david.weintraub at bofasecurities.com
Mon Sep 25 05:59:41 PDT 2006


Do you want to backup the *.db files, or would you be better off running
a live checkpoint, backing up the checkpoint file, and then backing up
the various depots?

I am thinking of this as a database consistency issue. If you cannot
stop or guarantee to stop users from submitting new versions or creating
branches and labels while you backup, you need to keep your database in
sync. Creating a checkpoint via the "p4d -r <p4Root> -jc" command
creates a new checkpoint. This can be done while the Perforce server is
up and running and it locks the database from any changes while a
checkpoint is being created -- thus keeping the database in a consistent
state.

After the checkpoint is created, you can backup the checkpoint, the
license, and the depot RCS files with the consistency of the Perforce
depot guaranteed. Yes, it is possible after you create the checkpoint,
but before you backup a specific RCS file, that the user has submitted a
new version of that file. That version will be ignored in the backup,
and the user will simply resubmit their change. (The missing version is
very likely to be on the user's computer, and if it isn't, you could
extract it from the depot using regular RCS commands.)


-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Arnt
Gulbrandsen
Sent: Monday, September 25, 2006 4:47 AM
To: perforce-user at perforce.com
Subject: Re: [p4] Backup scripts?

R. Tyler Ballance writes:
> I was wondering if anybody had any good ruby/python/perl scripts for 
> creating and tarballing backups of my entire perforce repository (all 
> three depots), once those tarballs exist, I am capable enough to write

> the scripts to rsync those to a remote server, but doing nightly 
> backups of the perforce repository (given its database and 
> metadata-centric approach to storing data) still eludes me :)

You don't need a script, just run tar on the entire perforce directory. 
The files you need to back up are db.*, license and all the
subdirectories (one per depot).

Since you're so small, you probably don't even need to stop the p4d
while you're making the copy. Just do it at night while noone submits.

Arnt
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user


More information about the perforce-user mailing list