Backuppc

BackupPc 因 SIGPIPE 而失敗

  • March 5, 2018

我在 Debian Squeeze 伺服器上執行 BackupPc。它成功地備份了我區域網路上的其他 Debian Squeeze 機器。我已將其設置為在 Wan 上備份另一台 Debian Squeeze 機器,但備份總是失敗並顯示錯誤消息:

Aborting backup up after signal PIPE
Got fatal error during xfer (aborted by signal=PIPE)

備份是通過ssh執行的,這個備份客戶端的配置是:

$Conf{RsyncArgs} = [
       # Do not edit these!
           '--numeric-ids',
           '--perms',
           '--owner',
           '--group',
           '--devices',
           '--links',
           '--times',
           '--block-size=2048',
           '--recursive',
       #
       # If you are using a patched client rsync that supports the
       # --checksum-seed option (see http://backuppc.sourceforge.net),
       # then uncomment this to enabled rsync checksum cachcing
       #
       '--checksum-seed=32761',
       #
       # Add additional arguments here
       #
       '-D',
       '--one-file-system',
];
$Conf{FullPeriod} = 6.97;
$Conf{IncrPeriod} = 0.49;
$Conf{FullKeepCnt} = 4;
$Conf{IncrKeepCnt} = 93;
$Conf{XferMethod} = 'rsync';
$Conf{RsyncShareName} = '/';
$Conf{BackupFilesExclude} = [
       '/cdrom',
       '/dev',
       '/files/_nobackup',
       '/floppy',
       '/lost+found',
       '/mnt',
       '/proc',
       '/sys',
       '/tmp/ssh-*',
       '/var/lib/amavis/amavisd.sock',
       '/var/lib/backuppc',
       '/var/lib/nagios3/rw/nagios.cmd',
       '/var/run/acpid.socket',
       '/var/run/clamav/clamd.ctl',
       '/var/run/courier/authdaemon/socket',
       '/var/run/mysqld/mysqld.sock',
       '/var/run/nut/usbhid-ups-apc_backups_cs500',
       '/var/run/proftpd.sock',
       '/var/run/screen',
       '/var/spool/postfix/private/amavis',
       '/var/spool/postfix/private/anvil',
       '/var/spool/postfix/private/bounce',
       '/var/spool/postfix/private/bsmtp',
       '/var/spool/postfix/private/defer',
       '/var/spool/postfix/private/discard',
       '/var/spool/postfix/private/error',
       '/var/spool/postfix/private/ifmail',
       '/var/spool/postfix/private/lmtp',
       '/var/spool/postfix/private/local',
       '/var/spool/postfix/private/maildrop',
       '/var/spool/postfix/private/odmr',
       '/var/spool/postfix/private/proxymap',
       '/var/spool/postfix/private/relay',
       '/var/spool/postfix/private/retry',
       '/var/spool/postfix/private/rewrite',
       '/var/spool/postfix/private/scache',
       '/var/spool/postfix/private/scalemail-backend',
       '/var/spool/postfix/private/smtp',
       '/var/spool/postfix/private/tlsmgr',
       '/var/spool/postfix/private/trace',
       '/var/spool/postfix/private/uucp',
       '/var/spool/postfix/private/verify',
       '/var/spool/postfix/private/virtual',
       '/var/spool/postfix/public/cleanup',
       '/var/spool/postfix/public/flush',
       '/var/spool/postfix/public/pickup',
       '/var/spool/postfix/public/qmgr',
       '/var/spool/postfix/public/showq',
       '/var/spool/postfix/var/run/saslauthd/mux',
       '/var/spool/squid',
];
$Conf{XferLogLevel} = 1;
$Conf{CompressLevel} = 9;
$Conf{PingMaxMsec} = 200;
$Conf{ClientTimeout} = 3600*8;          # 6 Hours!!

我嘗試了本地 tar 備份,以查看文件系統是否存在問題,一切正常。

關於如何調試的任何建議?

我已經研究了 sigpipe 的含義。如SIGPIPE - Wikipedia 中所述,免費的百科全書

在 POSIX 兼容的平台上,SIGPIPE 是當程序嘗試寫入管道而沒有程序連接到另一端時發送到程序的信號。…

所以我懷疑問題ssh出在斷開連接的傳輸上。

我在配置中設置了更長的超時時間來ssh使用 options -o ServerAliveInterval=300

$Conf{RsyncClientCmd} = '$sshPath -o ServerAliveInterval=300 -q -x -l root $host
$rsyncPath $argList+';

現在備份已成功完成!

引用自:https://serverfault.com/questions/348857