Just wondering if there were any thoughts on this, or if you need further description or clarification of the issue...

Thanks!

--Chris

On Aug 29, 2005, at 4:47 PM, Chris Stone wrote:

Hi,

Using BackupPC 2.1.1, I have $Conf{DumpPostUserCmd} set to run a script that creates an archive after each successful full backup:


$Conf{DumpPostUserCmd} = '/home/backuppc/postdump.pl $type $xferOK $client';


The script looks like this:


#!/usr/bin/perl

my $type = "$ARGV[0]";
my $xferOK = "$ARGV[1]";
my $client =  "$ARGV[2]";
my $archpath = "/archives/BUPC_ArchiveInProg/$client/";
my $stagepath = "/archives/ArchiveStage/";


if ($type eq "full") {
        if ($xferOK eq 1) {
                if (! -e "$archpath") {
        `mkdir $archpath`;
`/usr/local/backup/bin/BackupPC_archiveHost /usr/local/ backup/bin/BackupPC_tarCreate /usr/bin/split /usr/local/bin/par2 $client -1 /usr/bin/gzip .gz 2147000000 $archpath 0 "*"`;
                my $timestmp = `date +%g%m%d%H%M%S`;
                `mv $archpath $stagepath$client$timestmp` ;
         }
                }
}



I needed to include the "if (! -e "$archpath")" block in the script since I found that if the backup and archive writing go on for more than a couple hours, DumpPostUserCmd gets called again for some reason, and the script would start writing to the same directory and screw up the archive. With the if block, though, I at least get a complete archive written.


Still, however, an issue remains since that second invocation of DumpPostUserCmd exits with a non-zero even though the actual backup was successful, and so the entire backup is rendered "partial". That client then gets hit for another full at the next window (and the cycle repeats).

My questions then are:

Why might I be getting multiple calls to DumpPostUserCmd, and how can I prevent that? Is there a way to manually change the status of a partial backup to a valid full so I can at least stop the cycle of repeated full attempts?
Am I just going about this wrong?

Thanks!

--Chris


Below are my configs. First, that for an example client (it's a Mac, but I have the same problem with Linux clients as well):



$Conf{FullKeepCnt} = 1;
$Conf{FullKeepCntMin} = 1;
$Conf{FullAgeMax}     = 6;
$Conf{BackupFilesOnly} = ['/Users/chris/'];
$Conf{BackupFilesExclude} = ['/Users/chris/Music', '/Users/chris/ Movies', '/Users/chris/Pictures', '/Users/chris/Library/Caches', '/ Users/chris/Trash', '*.cache'];
$Conf{BlackoutBadPingLimit} = 3;
$Conf{BlackoutGoodCnt}      = 7;
$Conf{BlackoutPeriods} = [
    {
        hourBegin =>  7.0,
        hourEnd   => 19.5,
        weekDays  => [1, 2, 3, 4, 5],
    },
];
$Conf{BackupZeroFilesIsFatal} = 1;
$Conf{XferMethod} = 'tar';
$Conf{XferLogLevel} = 1;
$Conf{TarClientCmd} = '$sshPath -q -x -n -l root $hostIP'
                    . ' $tarPath -c -v -f - -C $shareName+'
                    . ' --totals';
$Conf{TarFullArgs} = '$fileList+';
$Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
$Conf{TarClientRestoreCmd} = '$sshPath -q -x -l root $host'
                   . ' $tarPath -x -p --numeric-owner --same-owner'
                   . ' -v -f - -C $shareName+';
$Conf{TarClientPath} = '/usr/bin/tar';
$Conf{NmbLookupCmd} = '';
$Conf{NmbLookupFindHostCmd} = '/usr/local/backup/bin/ mDNSLookupPath.sh $host';
$Conf{FixedIPNetBiosNameCheck} = 0;
$Conf{PingPath} = '/bin/ping';
$Conf{PingCmd} = '$pingPath -c 1 -w 3 $host';
$Conf{CompressLevel} = 3;
$Conf{PingMaxMsec} = 40;
$Conf{ClientTimeout} = 7200;
$Conf{MaxOldPerPCLogFiles} = 12;





And this is the main config.pl:



$Conf{ServerHost} = 'xxxxxxx';
$Conf{ServerPort} = -1;
$Conf{ServerMesgSecret} = 'xxxxxxx';
$Conf{MyPath} = '/bin';
$Conf{UmaskMode} = 027;
$Conf{WakeupSchedule} = [1,2,3,4,5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14 ,14.5,15,15.5,16,16.5,17,18,19,20,21,22,23,24];
$Conf{MaxBackups} = 4;
$Conf{MaxUserBackups} = 4;
$Conf{MaxPendingCmds} = 10;
$Conf{MaxBackupPCNightlyJobs} = 2;
$Conf{BackupPCNightlyPeriod} = 2;
$Conf{MaxOldLogFiles} = 14;
$Conf{DfPath} = '/usr/bin/df';
$Conf{DfCmd} = '$dfPath $topDir';
$Conf{SplitPath} = '/usr/bin/split';
$Conf{ParPath}   = '/usr/local/bin/par2';
$Conf{CatPath}   = '/usr/bin/cat';
$Conf{GzipPath}  = '/usr/bin/gzip';
$Conf{Bzip2Path} = '/usr/bin/bzip2';
$Conf{DfMaxUsagePct} = 95;
$Conf{TrashCleanSleepSec} = 300;
$Conf{DHCPAddressRanges} = [];
$Conf{BackupPCUser} = 'xxxxx';
$Conf{CgiDir}       = '/online/apache/cgi-bin';
$Conf{InstallDir}   = '/usr/local/backup';
$Conf{BackupPCUserVerify} = 1;
$Conf{HardLinkMax} = 31999;
$Conf{SmbShareName} = 'xxxxxx';
$Conf{SmbShareUserName} = 'xxxxxx';
$Conf{SmbSharePasswd} = 'xxxxxxx';
$Conf{TarShareName} = '/';
$Conf{FullPeriod} = 13.97;
$Conf{IncrPeriod} = 0.97;
$Conf{FullKeepCnt} = 1;
$Conf{FullKeepCntMin} = 1;
$Conf{FullAgeMax}     = 60;
$Conf{IncrKeepCnt} = 13;
$Conf{IncrKeepCntMin} = 1;
$Conf{IncrAgeMax}     = 30;
$Conf{PartialAgeMax} = 3;
$Conf{IncrFill} = 0;
$Conf{RestoreInfoKeepCnt} = 10;
$Conf{ArchiveInfoKeepCnt} = 10;
$Conf{BackupFilesOnly} = undef;
$Conf{BackupFilesExclude} = undef;
$Conf{BlackoutBadPingLimit} = 3;
$Conf{BlackoutGoodCnt}      = 9;
$Conf{BlackoutPeriods} = [
    {
        hourBegin =>  7.0,
        hourEnd   => 19.5,
        weekDays  => [1, 2, 3, 4, 5],
    },
];
$Conf{BackupZeroFilesIsFatal} = 1;
$Conf{XferMethod} = 'smb';
$Conf{XferLogLevel} = 1;
$Conf{SmbClientPath} = '/usr/bin/smbclient';
$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
            . ' $I_option -U $userName -E -N -d 1'
            . ' -c tarmode\\ full -Tc$X_option - $fileList';
$Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
            . ' $I_option -U $userName -E -N -d 1'
. ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
$Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
            . ' $I_option -U $userName -E -N -d 1'
            . ' -c tarmode\\ full -Tx -';
$Conf{TarClientCmd} = '$sshPath -q -n -l root $host'
                    . ' $tarPath -c -v -f - -C $shareName+'
                    . ' --totals';
$Conf{TarFullArgs} = '$fileList+';
$Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
$Conf{TarClientRestoreCmd} = '$sshPath -q -l root $host'
                   . ' $tarPath -x -p --numeric-owner --same-owner'
                   . ' -v -f - -C $shareName+';
$Conf{TarClientPath} = '/bin/tar';
$Conf{RsyncClientPath} = '/usr/bin/rsync';
$Conf{RsyncClientCmd} = '$sshPath -l root $host $rsyncPath $argList +'; $Conf{RsyncClientRestoreCmd} = '$sshPath -l root $host $rsyncPath $argList+';
$Conf{RsyncShareName} = '/';
$Conf{RsyncdClientPort} = 873;
$Conf{RsyncdUserName} = '';
$Conf{RsyncdPasswd} = '';
$Conf{RsyncdAuthRequired} = 1;
$Conf{RsyncCsumCacheVerifyProb} = 0.01;
$Conf{RsyncArgs} = [
            #
            # Do not edit these!
            #
            '--numeric-ids',
            '--perms',
            '--owner',
            '--group',
            '--devices',
            '--links',
            '--times',
            '--block-size=2048',
            '--recursive',
            #
            # Add additional arguments here
            #
];
$Conf{RsyncRestoreArgs} = [
            #
            # Do not edit these!
            #
            "--numeric-ids",
            "--perms",
            "--owner",
            "--group",
            "--devices",
            "--links",
            "--times",
            "--block-size=2048",
            "--relative",
            "--ignore-times",
            "--recursive",
            #
            # Add additional arguments here
            #
];
$Conf{ArchiveDest} = '/tmp';
$Conf{ArchiveComp} = 'gzip';
$Conf{ArchivePar} = 0;
$Conf{ArchiveSplit} = 0;
$Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost'
        . ' $tarCreatePath $splitpath $parpath $host $backupnumber'
        . ' $compression $compext $splitsize $archiveloc $parfile *';
$Conf{SshPath} = '/usr/bin/ssh';
$Conf{NmbLookupPath} = '/usr/bin/nmblookup';
$Conf{NmbLookupCmd} = '$nmbLookupPath -A $host';
$Conf{NmbLookupFindHostCmd} = '/usr/local/backup/bin/ nmbLookupPath.sh $host';
$Conf{FixedIPNetBiosNameCheck} = 0;
$Conf{PingPath} = '/bin/ping';
$Conf{PingCmd} = '$pingPath -c 1 -w 3 $host';
$Conf{ServerInitdPath} = '';
$Conf{ServerInitdStartCmd} = '';
$Conf{CompressLevel} = 3;
$Conf{PingMaxMsec} = 30;
$Conf{ClientTimeout} = 7200;
$Conf{MaxOldPerPCLogFiles} = 12;
$Conf{DumpPreUserCmd}     = undef;
$Conf{DumpPostUserCmd} = '/home/backuppc/postdump.pl $type $xferOK $client';
$Conf{RestorePreUserCmd}  = undef;
$Conf{RestorePostUserCmd} = undef;
$Conf{ArchivePreUserCmd}  = undef;
$Conf{ArchivePostUserCmd} = undef;
$Conf{ClientNameAlias} = undef;
$Conf{PerlModuleLoad}     = undef;



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/ bsce5sf
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to