#!/bin/bash
#==============================================================================
# Copyright and license info is available in the LICENSE file included with
# the Server Deployment Package (SDP), and also available online:
# https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE
#------------------------------------------------------------------------------
# This script is intended to be run on a standby replica. It essentially just
# calls 'p4 admin checkpoint -Z' to request a checkpoint and exits. The actual
# checkpoint is created on the next journal rotation on the master.
export SDP_INSTANCE="${SDP_INSTANCE:-Unset} "
export SDP_INSTANCE="${1:-$SDP_INSTANCE}"
if [[ "$SDP_INSTANCE" == Unset ]]; then
echo "Instance parameter not supplied."
echo "You must supply the Perforce instance as a parameter to this script."
exit 1
fi
# shellcheck disable=SC1091
source /p4/common/bin/p4_vars "$SDP_INSTANCE"
# shellcheck disable=SC1091
source /p4/common/bin/backup_functions.sh
# shellcheck disable=SC2034
LOGFILE=$LOGS/request_checkpoint.log
######### Start of Script ##########
check_vars
set_vars
rotate_last_run_logs
log "Start $P4SERVER Replica Request Checkpoint"
check_uid
check_dirs
[[ "$P4MASTER_ID" == "$SERVERID" ]] && \
die "Error: Do not run request_replica_checkpoint.sh on the commit server."
"$P4CBIN"/p4login
request_replica_checkpoint
remove_old_checkpoints_and_journals
remove_old_logs
log "End $P4SERVER Replica Checkpoint"
mail_log_file "$HOSTNAME $P4SERVER replica request checkpoint log."
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #6 | 31077 | C. Thomas Tyler |
Released SDP 2024.2.31075 (2024/12/20). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
| #5 | 30915 | C. Thomas Tyler |
Released SDP 2024.1.30913 (2024/11/20). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
| #4 | 30388 | C. Thomas Tyler |
Released SDP 2024.1.30385 (2024/06/11). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
| #3 | 30297 | C. Thomas Tyler |
Released SDP 2023.2.30295 (2024/05/08). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
| #2 | 27761 | C. Thomas Tyler |
Released SDP 2020.1.27759 (2021/05/07). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
| #1 | 25933 | C. Thomas Tyler |
Released SDP 2019.2.25923 (2019/08/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
| //guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/request_replica_checkpoint.sh | |||||
| #1 | 25923 | C. Thomas Tyler |
Added script to request a checkpoint on the next journal rotation, for use on replicas (e.g. replicas of edge servers). To Do: Test needed, requires sophisticated topology to test. |
||