BackupPC

Adding backuppc using backports

apt-get install backuppc/lucid-backports
Change backuppc password
sudo htpasswd /etc/backuppc/htpasswd backuppc

??Change user home dir to /home/backuppc ? so i do not have to update sshid everytime i reinstall backuppc to fix the external drive setup
??Change user uid and gid to match proxmox? dosnt really matter anymore not using bindmounts or nfs

Windozes client

Add a backuppc Administrator user and add him to the Backup http://www.computerking.ca/node/612/editOperators Group I do not think Backup Operator Group is nessary and rarely works!

cmd
net localgroup "Backup Operators" "" /add
mkdir c:\cygwin\packages

For the rest of the windows installation follow this post which i will condense here someday in case remote site goes away.

http://www.cs.umd.edu/~cdunne/projs/backuppc_guide.html#Client Setup (Windows 7/Vista/XP)

Linux Client

aptitude install sudo rsync
adduser backuppc
echo "backuppc ALL=NOPASSWD: /usr/bin/rsync" >> /etc/sudoers

Do this on the backuppc server

Create the key

 
sudo -i
su backuppc
bash
ssh-keygen -t rsa

Copy the key
sudo -i
su backuppc
ssh-copy-id ‘-p highport username@client’

if you don’t have ssh-copy-id, use the following.

scp -P highport /var/lib/backuppc/.ssh/id_rsa.pub username@client:~/.ssh/backuppc_id_rsa.pub
ssh -p highport username@client
cat ~/.ssh/backuppc_id_rsa.pub >> ~/.ssh/authorized_keys
rm ~/.ssh/backuppc_id_rsa.pub

Add a backuppc web user i usually make them match the email address
htpasswd /etc/backuppc/htpasswd clientemail

RsyncCmd lines for backup on local machine preferably to another hard drive

$sshPath -q -x -l backuppc -p 22 $host sudo $rsyncPath $argList+

RsyncCmd Lines for remote systems

$sshPath -q -x -l backuppc -p 22 $host $rsyncPath $argList+

Some Useful commands

wish i could figure out a way to make this work with tail -f seen it once somewhere, but never been able to find it since. If anyone know how please leave me a comment.

/usr/share/backuppc/bin/BackupPC_zcat /var/lib/backuppc/pc/10.22.22.200/XferLOG.z

tail -f /var/lib/backuppc/pc/10.22.22.200/NewFileLis

The .pl file i am using to backup the local host still trying to figure out how to get the * excludes to work!

$Conf{RsyncShareName} = [
  '/',
  '/boot',
  '/var/lib/vz'
];
$Conf{BackupFilesExclude} = {
  '/' => [
    '/home/c0mputerking/mondoarchives'
  ],
  '/var/lib/vz' => [
    '*/proc',
    '*/sys',
    '/vztemp',
    '/root',
    '/private',
    '/dump',
    '/images',
    '/templates/iso',
    '/tempates/images',
    '/solar/venus',
    '/solar/pluto',
    '/solar/earth'
  ],
  '*' => [
    'proc',
    '/proc',
    '**/proc',
    'tmp',
    '**/tmp',
    'temp',
    '**/temp',
    '*cache',
    '**/cache'
  ]
};
$Conf{RsyncClientCmd} = '$sshPath -q -x -l backuppc -p 22 $host sudo $rsyncPath $argList+';
$Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l backuppc -p 22 $host sudo $rsyncPath $argList+';
$Conf{BackupFilesOnly} = {};
$Conf{RsyncArgs} = [
  '--numeric-ids',
  '--perms',
  '--owner',
  '--group',
  '-D',
  '--links',
  '--hard-links',
  '--times',
  '--block-size=2048',
  '--recursive',
  '--one-file-system'
];

1. Use keys (which represent the transfer root) for greater clarity
2. Exclude needs to be relative to the transfer root
3. Make sure you’re using rsync exclude syntax properly!

For example, I have a RsyncShareName /service, under which is a chroot environment containing /proc, /var/lib/mysql etc. I want those folders to exist in my backup, but not their contents (for obvious reasons). Therefore, I made a BackupFilesExclude key /service and for it I added /proc/** and /var/lib/mysql/**. Works as intended.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.