#!/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 designed to rebuild an Edge server from a checkpoint off the master. # You have to first copy the checkpoint from the master to the edge server before running this script. # Then you run this script on the Edge server with the instance number and full path and filename # of the master checkpoint as parameters. # # Run example: # ./recover.sh 1 /depotdata/p4_1.ckp.9188.gz if [[ "$1" == "" ]]; then echo You must pass in the instance number as the first parameter to this script. exit 1 fi if [[ "$2" == "" ]]; then echo You must pass in the full path and filename of the checkpoint you copied over from the master server. exit 2 fi INSTANCE=$1 MASTERCKP=$2 rm -f /p4/${INSTANCE}/offline_db/db.* /p4/${INSTANCE}/bin/p4d_${INSTANCE} -r /p4/${INSTANCE}/offline_db/ -K db.have,db.working,db.resolve,db.locks,db.revsh,db.workingx,db.resolvex -jr -z $MASTERCKP /p4/${INSTANCE}/bin/p4d_${INSTANCE}_init stop /p4/${INSTANCE}/bin/p4d_${INSTANCE} -r /p4/${INSTANCE}/root/ -k db.have,db.working,db.resolve,db.locks,db.revsh,db.workingx,db.resolvex,db.view,db.label,db.revsx,db.revux -jd /p4/${INSTANCE}/checkpoints/edgedump /p4/${INSTANCE}/bin/p4d_${INSTANCE} -r /p4/${INSTANCE}/offline_db -jr /p4/${INSTANCE}/checkpoints/edgedump rm -f /p4/${INSTANCE}/root/db.* rm -f /p4/${INSTANCE}/root/state rm -f /p4/${INSTANCE}/root/rdb.lbr rm -f /p4/${INSTANCE}/logs/journal mv /p4/${INSTANCE}/offline_db/db.* /p4/${INSTANCE}/root/ /p4/${INSTANCE}/bin/p4d_${INSTANCE}_init start /p4/${INSTANCE}/bin/p4d_${INSTANCE} -r /p4/${INSTANCE}/offline_db/ -K db.have,db.working,db.resolve,db.locks,db.revsh,db.workingx,db.resolvex -jr -z $MASTERCKP /p4/${INSTANCE}/bin/p4d_${INSTANCE} -r /p4/${INSTANCE}/offline_db -jr /p4/${INSTANCE}/checkpoints/edgedump /p4/${INSTANCE}/bin/p4d_${INSTANCE} -r /p4/${INSTANCE}/offline_db -jd -z /p4/${INSTANCE}/checkpoints/rebuilt_edge_dump.gz echo Rebuilt checkpoint is: /p4/${INSTANCE}/checkpoints/rebuilt_edge_dump.gz echo If you run this script the night before a weekly_backup.sh is going to run, echo you need to delete the highest numbered checkpoint in /p4/${INSTANCE}/checkpoints echo and rename /p4/${INSTANCE}/checkpoints/rebuilt_edge_dump.gz to replace that file.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#15 | 28240 | C. Thomas Tyler |
Released SDP 2021.1.28238 (2021/11/12). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#14 | 27331 | C. Thomas Tyler |
Released SDP 2020.1.27325 (2021/01/29). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#13 | 26496 | C. Thomas Tyler |
Released SDP 2019.3.26494 (2020/04/23). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#12 | 25951 | C. Thomas Tyler |
Released SDP 2019.2.25949 (2019/08/12). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#11 | 25940 | C. Thomas Tyler |
Released SDP 2019.2.25938 (2019/08/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#10 | 25933 | C. Thomas Tyler |
Released SDP 2019.2.25923 (2019/08/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#9 | 23331 | C. Thomas Tyler |
Released SDP 2017.4.23329 (2017/12/05). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#8 | 23006 | C. Thomas Tyler |
Released SDP 2017.3.23003 (2017/10/19). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#7 | 21338 | C. Thomas Tyler |
Released SDP 2016.2.21328 (2016/12/16). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#6 | 19414 | C. Thomas Tyler | Released SDP/MultiArch/2016.1/19410 (2016/05/17). | ||
#5 | 17315 | C. Thomas Tyler |
Released SDP/MultiArch/2016.1/17297 (2016/02/03). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#4 | 16845 | C. Thomas Tyler | Fixed typo in script name in a comment; no functional change. | ||
#3 | 15856 | C. Thomas Tyler |
Replaced the big license comment block with a shortened form referencing the LICENSE file included with the SDP package, and also by the URL for the license file in The Workshop. |
||
#2 | 15777 | C. Thomas Tyler |
No functional changes. Style Policing only on bash scripts only. Normalized indentation and line breaks, removed offending tabs, and general whitespace usage. |
||
#1 | 15716 | Russell C. Jackson (Rusty) | Script for rebuilding an Edge server. |