[p4] Backup procedure help required - script for Perforce in Windows (DOS/VBS)?
paul goffin
paul.goffin at dsl.pipex.com
Thu Jul 26 23:54:16 PDT 2007
> Hello, I am a new Perforce user.
Welcome. (BTW, Perforce IS easier than you think..)
> Does anyone have an automated backup script for Perforce running on
> Windows, which they could share?
There are probably some in the public depot but what I did when
I ran a Windows Perforce server was to simply have an
"AT" job which ran a command file with a single line in it
which was, IIRC:
"C:\Perforce\Progra~1\p4d -r e:\PerforceDepot -J f:\PerforceJournal\journal -jc -z"
> Also, I do not understand what this step in the Perforce backup
> procedure means:
>
> "3. Ensure that the checkpoint has been created successfully before
> backing up any files. (After a disk crash, the last thing you want to
> discover is that the checkpoints you've been backing up for the past
> three weeks were incomplete!)
It's just about sequencing. To be perfectly consistent, Perforce checkpoints
need to be older than the Perforce depot files. (i.e. if you end up having
to do a recovery, if your files are older than your checkpoint + journal
then you _may_ have an inconsistent depot. If it's the other way round,
you definitely will not.)
So arrange the AT job to run an hour before your backup tapes run.
> You can tell that the checkpoint command has completed successfully
> by examining the error code returned from p4d -jc, or by observing
> the truncation of the current journal file."
> A. How do I examine the error code, and what do I look for?
In 10 years of running Perforce servers, I've never bothered to:-)
> B. What am I supposed to observe about the truncation of the current
> journal file?
That it has been truncated. When you do a checkpoint, everything
in the journal is taken into account, so the journal records are
no longer needed.
As part of the checkpoint process, the old journal will be renamed
with a numbered extension and a new one will be created with (IIRC)
just one record in it - the record of the number that was used on
the last journal file extension.
Paul.
More information about the perforce-user
mailing list