2010-12-14 5 views

답변

6

짧은 대답 : 아니요
긴 답 : PERFORCE 데이터의 백업 및 복구에 대해 알아야 할 것은 Manual입니다. 급한 사람을위한 한마디로 :

  1. P4가 확인 // ...
    이 (서버의 무결성을 확인합니다)
  2. P4 관리 체크 포인트는
    는 (체크 포인트를 확인, 확인이 단계는 성공이다)
  3. 다시 검사 점 파일과 기존의 저널 파일
    (최대 당신은 당신이 다시 버전 화 파일
    최대
  4. (즉이다)해야 저널 파일과 퍼포를 실행하는 경우 실제 데이터를 PERFORCE 서버 디렉토리의 db. * 파일과 혼동하지 마십시오.)

그러나 특히 다양한 복원 시나리오에 대해서는 매뉴얼을 읽으십시오. 기억 : 백업은 일반적으로 정상적으로 작동하지만 실패한 복원입니다.

+0

단계, 당신은 기존의 저널 파일이 필요하지 않습니다. 문서를 다시 읽으십시오. 또한 새로운 체크 포인트를 만들지 않으려면 1 단계와 2 단계를 생략하고 현재 저널 파일을 백업하는 것이 좋습니다. – cmcginty

+0

백업 실행 중에 아무 것도 제출하지 않으려는 단일 사용자가 간단하게 설치하려면 서버 중지 (예 : p4 admin stop), 데이터베이스 및 저장소 파일의 복사본 작성 및 서버 재시작 ? – Joe

4

p4 매뉴얼 대답 (permalink)에서 jhwist가 올바른 것 외에도 몇 년 동안 Perforce를 사용하면서 배운 몇 가지 사항을 추가하고 싶습니다. 이 될 것입니다 동안 몇 시간이 걸릴 수있는 P4 데이터베이스에서 확인 수행 저장소의 크기에 따라

은 ...
잠겨 아무도 어떤 쿼리를 수행 할 수 없습니다. P4 데이터베이스를 잠그면 사용자에게 여러 가지 흐름 효과를 줄 수 있습니다. 예를 들어, 누군가 P4SCC 플러그인 (예 : 비주얼 스튜디오 통합)을 사용 중이거나 P4를 사용하려고 시도하면 P4SCC 플러그인이 회전하여 결국 사용자가 그만 두어 통제를 회복해야한다.

해결

  1. 스폰 다른 포트 (p4d_2)에 P4D 번째 인스턴스가
  2. /일시 메인 인스턴스 (p4d_1)를 종료.
  3. p4 verify //...을 수행하고 p4d_2를 사용하여 검사 점을 수행하십시오.
  4. 스토리지 배열의 물리적 버전 파일을 백업합니다.
  5. 킬 p4d_2.
  6. p4d_1을 다시 시작하십시오.

또한이 같이 가능성이 철저하게 검사 점 로그 파일을 읽을 필요가 성공적으로 완료되었는지 확인하기 위해 충분히 강조 할 수는 없습니다 야간이나 주말에 실행 자동화 된 프로세스 수보다 더 많은 것 그렇지 않으면 복원을 수행해야 할 때 어려운 위치에있게됩니다 (다음 요점 읽기). 백업은 설정되어서는 안되며 절차도 잊어서는 안됩니다.

PERFORCE 백업에 대한 자세한 내용은 PERFORCE 백서 : High Availability And Disaster Recovery Solutions For Perforce에서 확인할 수 있습니다.난 내 자신의 개발 워크 스테이션에 추가 백업 전략을 사용했다

0

FWIW

HTH. 매일 밤마다 실행되는 perl 스크립트를 가지고 있으며 주어진 작업 공간 목록에서 Perforce에서 체크 아웃 한 모든 파일을 찾습니다. 그러면 파일 목록이 정상적인 워크 스테이션 백업 절차의 일부로 백업됩니다. 체크 아웃 된 파일을 찾는 Perl 스크립트는 나에게 매우 까다로운 것처럼 보입니다. 나는 그것을 쓰지 않았고 특히 Perl에 익숙하지 않았습니다.

누구든지 관심이있는 경우 여기에 스크립트를 게시 할 수 있습니다.

이 스크립트는 Perforce가 "쉘빙"기능을 갖기 전에 개발되었습니다. 나는 매일 밤 내 작업을 "선반에 쌓아 두는"스크립트를 사용하는 것이 나을지도 모른다. (현재의 백업 전략이나 그 대신에).

# This script copies any files that are opened for any action (other than 
# delete) in the specified client workspace to another specified directory. 
# The directory structure of the workspace is duplicated in the target 
# directory. Furthermore, a file is not copied if it already exists in the 
# target directory unless the file in the workspace is newer than the one 
# in the target directory. 

# Note: This script looks at *all* pending changelists in the specified 
# workspace. 
# Note: This script uses the client specification Root to get the local 
# pathname of the files. So if you are using a substituted drive for the 
# client root, it must be properly substituted before running this script. 

# Argument 1: Client workspace name 
# Argument 2: Target directory (full path) 

use File::Path; 
# use File::Copy; 
use File::Basename; 
use Win32; 

if ($#ARGV != 1) { 
    die("usage: $0 client_name target_directory\n"); 
} 

my $client = shift(@ARGV); 
my $target_dir = shift(@ARGV); 
my @opened_files =(); 
my $client_root = ""; 
my $files_copied = 0; 

# I need to know the root directory of the client, so that I can derive the 
# local pathname of the file. Strange that "p4 -ztag opened" doesn't give 
# me the local pathname; I would have expected it to. 

open(CLIENT_SPEC, "p4 -c $client client -o|") 
     || die("Cannot retrieve client specification: $!"); 
while (<CLIENT_SPEC>) { 
    my ($tag, $value) = split(/\s/, $_, 2); 
    if ($tag eq "Root:") { 
     $value = chop_line($value); 
     $client_root = $value; 
    } 
} 
close(CLIENT_SPEC); 
if ($client_root eq "") { 
    die("Unable to determine root of client $client\n"); 
} elsif (substr($client_root, -1) ne "\\") { 
    $client_root = $client_root . "\\"; 
} 

# Use the -ztag option so that we can get the client file path as well as 
# the depot path. 

open(OPENED_FILES, "p4 -c $client -ztag opened|") 
     || die("Cannot get list of opened files: $!"); 
while (<OPENED_FILES>) { 
    # What we do is to get the client path and append it onto the 
    # @opened_files array. Then when we get the action, if it is a delete, 
    # we pop the last entry back off the array. This assumes that the tags 
    # come out with clientFile before action. 

    $_ = chop_line($_); 
    my ($prefix, $tag, $value) = split(/\s/, $_, 3); 
    if ($tag eq "clientFile") { 
     push(@opened_files, $value); 
    } 
    if (($tag eq "action") && ($value eq "delete")) { 
     pop(@opened_files); 
    } 
} 
close(OPENED_FILES); 

# Okay, now we have the list of opened files. Process each file to 
# copy it to the destination. 

foreach $client_path (@opened_files) { 

    # Trim off the client name and replace it with the client root 
    # directory. Also replace forward slashes with backslashes. 

    $client_path = substr($client_path, length($client) + 3); 
    $client_path =~ s/\//\\/g; 
    my $local_path = $client_root . $client_path; 

    # Okay, now $client_path is the partial pathname starting at the 
    # client's root. That's the path we also want to use starting at the 
    # target path for the destination. 

    my $dest_path = $target_dir . "\\" . $client_path; 
    my $copy_it = 0; 

    if (-e $dest_path) { 
     # Target exists. Is the local path newer? 
     my @target_stat = stat($dest_path); 
     my @local_stat = stat($local_path); 

     if ($local_stat[9] > $target_stat[9]) { 
      $copy_it = 1; 
     } 
    } else { 
     # Target does not exist, definitely copy it. But we may have to 
     # create some directories. Use File::Path to do that. 

     my ($basename, $dest_dir) = fileparse($dest_path); 
     if (! (-e $dest_dir)) { 
      mkpath($dest_dir) || die("Cannot create directory $dest_dir\n"); 
     } 
     $copy_it = 1; 
    } 

    if ($copy_it) { 
     Win32::CopyFile($local_path, $dest_path, 1) 
       || warn("Could not copy file $local_path: $!\n"); 
     $files_copied++; 
    } 
} 
print("$files_copied files copied.\n"); 

exit(0); 

################ Subroutines ######################################### 

# chop_line removes any trailing carriage-returns or newlines from its 
# argument and returns the possibly-modified string. 

sub chop_line { 
    my $string = shift; 

    $string =~ s/[\r\n]*\z//; 
    return $string; 
} 

실행하려면 : 여기

스크립트입니다 새 검사 점을 일단 3가 잘못

REM Make sure that we are pointing to the current Perforce server 
P4 set -s P4PORT=MyPerforceServer:ThePortThatPerforceIsOn 


p4 set p4client=MyPerforceWorkspace 

REM Copy checked out files to a local directory that will be backed up 
.\p4backup.pl MyPerforceWorkspace c:\PerforceBackups\MyPerforceWorkspace_backup