[p4] Old checkpoints and journal
Albrecht, Matt
matt.albrecht at zilliant.com
Thu May 4 08:44:02 PDT 2006
I keep 8 previous versions around. It probably shouldn't matter, but it
makes me feel a bit more comfortable because it can cover about a week's
worth of history in case something goes awry while I'm on vacation for a
week. Old journal files are used by a script to keep our hot-backup
server in sync with the live version; by having the old versions around,
the script can restart on a hang-up where it last left off.
To remove old checkpoints and journal files, I use a simple bash script
in a daily cron-job that essentially just runs:
CHKPT_FILES_F="/tmp/$$.chkpt-files"
find $P4D_ARCHIVEDIR -follow -type f -iname 'backup.ckp.*.gz' -printf
'%p\n' | sort > $CHKPT_FILES_F
chkpt_filecount=$(cat $CHKPT_FILES_F | wc --lines)
if [ $chkpt_filecount -gt $MAX_ARCHIVED_FILES ]; then
delcount=$(($chkpt_filecount - $MAX_ARCHIVED_FILES))
for _I in $(head -n $delcount $CHKPT_FILES_F); do
/bin/rm "$_I" > /dev/null
done
fi
This ensures that there are always $MAX_ARCHIVED_FILES around, without
having to worry about if a nightly backup didn't create the checkpoint
files for some reason - that would be a different problem, and I
wouldn't want the clean-up script stomping over stuff just because of
the date.
--Matt
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of
> Philippe Paquet
> Sent: Wednesday, May 03, 2006 4:37 PM
> To: perforce-user at perforce.com
> Subject: [p4] Old checkpoints and journal
>
> Hi Guys,
>
> We are currently doing a checkpoint every day on a pretty large and
> active depot which generate a fair amount of data (150Mb+). I
> would like
> to setup an automatic process to remove old checkpoints and journals.
> How long do you keep your old checkpoints and journal? What kind of
> process to you use to remove old checkpoints and journal?
>
> Cheers,
> Philippe
> ---
> Philippe Paquet
> Technical Director
> The Collective Inc, a Foundation 9 Entertainment company
> Phone: (949) 255 1900 x 870
> Fax: (949) 724 9667
> Email: philippep at collectivestudios.com
> www.f9e.com
> www.collectivestudios.com
>
> _______________________________________________
> 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