#!/bin/bash #******************************************************************************* #* Name : p4d.checkpoint #* Description : Take checkpoint of Perforce database #******************************************************************************* . /etc/p4d.conf /bin/su - perforce -c ". /etc/p4d.conf; /usr/bin/p4 verify -qu //..." /bin/su - perforce -c ". /etc/p4d.conf; /usr/bin/p4d -z -jc" # Remove all checkpoints/journals older than 2 weeks find $P4ROOT -maxdepth 1 \( -name checkpoint.\[0-9\]\*.gz -or \ -name journal.\[0-9\]\*.gz \) \ -a -mtime +14 |\ xargs rm -f