BackupPC help needed

Discussion in 'HOWTO-Related Questions' started by lordshadow, Jul 23, 2008.

  1. lordshadow

    lordshadow New Member


    I've been studying the howto on BackupPC for Debian Etch:

    However my problem is that Page3 part 4 describes how to implement the host file for DHCP and Netbios users.

    I am running an Etch server which has samba server active however my linux clients don't run samba therefore they do not have nmbd installed.

    Is there a way to use Rsync method withIP address of hosts only?
    -Or should I create DNS entries for them in my DNS server?

    For something like:

    host        dhcp    user      moreUsers
    IPaddress1     0     user1     anotheruser,athirduser
    IPaddress2     1     user2     stillanotheruser

    Also the server running BackupPC is my main server, everyone on the network works from /home partition. Therefore i need to backup local host but how can I do this if backup methods are only tar rsync and rsyncd??

    My 2nd issue is that I want to store the backup data onto NAS! I have mounted it under /mnt so is there a way of changing the BackupPC save DIR from: /var/lib/backuppc

    The NAS is currently formatted to FAT32 would this work with backupPC, ofcourse taking into account the file system restrictions such as incapability of >5GB file size? - Later I plan to use a RAID5 NAS array which will work in the same principle though not sure of filesystem yet but for now just to learn how to use the software :)

    Last edited: Jul 23, 2008
  2. lordshadow

    lordshadow New Member

    Ok I have found after some background reading:

    Option 2
    The BEST option is to change the archive directory in the config file
    edit /etc/backuppc/ and change the archive directory to /data
    The archive directory is defined by $TopDir in Unfortunately, the current version honors this value for host data, but the pool directories continue to use the default path that is hard-coded at install time. For now, in addition to changing, you will also need to edit lib/BackupPC/, and change the value in $topDir='/path...'.
    However with this do I change $TopDir in as the location contains it adn reffers to it as TopDir??

    sub new
        my $class = shift;
        my($topDir, $installDir, $noUserCheck) = @_;
        my $bpc = bless {
            TopDir  => $topDir || '/var/lib/backuppc',
            BinDir  => $installDir || '/usr/share/backuppc',
            LibDir  => $installDir || '/usr/share/backuppc',

    Also as default BackupPC is set to backup localhost /etc DIR, however:

    This is the error message I'm getting:

    CheckHostAlive: returning 0.086
    Running: /usr/bin/env LC_ALL=C /bin/tar -c -v -f - -C /etc --totals .
    started full dump, share=/etc
    Xfer PIDs are now 1976,1975
    xferPids 1976,1975
    cmdExecOrEval: about to exec /usr/bin/env LC_ALL=C /bin/tar -c -v -f - -C /etc --totals .
    /bin/tar: .: Cannot open: Permission denied
    Total bytes written: 10240 (10KiB, 28MiB/s)
    /bin/tar: Error exit delayed from previous errors
    Tar exited with error 512 () status
    tarExtract: Done: 0 errors, 0 filesExist, 0 sizeExist, 0 sizeExistComp, 0 filesTotal, 0 sizeTotal
    Got fatal error during xfer (No files dumped for share /etc)
    cmdSystemOrEval: about to system /bin/ping -c 1 localhost
    cmdSystemOrEval: finished: got output PING localhost.localdomain ( 56(84) bytes of data.
    64 bytes from localhost.localdomain ( icmp_seq=1 ttl=64 time=0.086 ms
    And again if anyone knows anything with the file

    as both these fail:

    nmblookup <falko-desktop>

    # nmblookup Vaio
    WARNING: The "printer admin" option is deprecated
    querying Vaio on
    name_query failed to find name Vaio
    # nmblookup -A
    WARNING: The "printer admin" option is deprecated
    Looking up status of
    No reply from
    The system Vaio is static at ip address but hasn't got samba installed for nmbd - so what would be the next step without installing samba ?

  3. lordshadow

    lordshadow New Member

    Finally I have some good news! I manages to backup the Vaio; turns out the DNS records that backuppc was talking about are in the /etc/hosts file.

    However I still can't backup localhost with tar method as default, issue is:

    /bin/tar: .: Cannot open: Permission denied
    Not sure why this is I may have to give backuppc permission to executre tar but not sure how to do that!

    Also folder root, if anyone can help with that I would really apprieciate it!

    Any help would be great thanks!
  4. falko

    falko Super Moderator ISPConfig Developer

    I guess the error is related to your current directory (.), not /bin/tar.
  5. lordshadow

    lordshadow New Member

    Yup the directory permissions seem to be the issue here, however since the server is a fully functional main server I would like to backup the whole / filesystem which means that I need to give backuppc rw access to everything.

    How can I do this? Do I add it to group root with limited access?


    I also have a problem in backing up other machines as each time I try to execute a backup I get an xFER error:

    Contents of file /var/lib/backuppc/pc/gx270d/XferLOG.bad.z, modified 2008-07-26 20:40:16 (Extracting only Errors)
    Running: /usr/bin/ssh -q -x -l root gx270d /usr/bin/rsync --server --sender --numeric-ids --perms --owner --group --devices --links --times --block-size=2048 --recursive -D --ignore-times . /etc/
    Xfer PIDs are now 28913
    Got remote protocol 1953722184
    Fatal error (bad version): Host key verification failed.
    Read EOF: Connection reset by peer
    Tried again: got 0 bytes
    fileListReceive() failed
    Done: 0 files, 0 bytes
    Got fatal error during xfer (fileListReceive failed)
    Backup aborted (fileListReceive failed)
    This is strange as I got my first machine: vaio, working! The only thing I did differently was to copy the .ssh folder from vaio over to the current machine gx270d.

    I also msised out this step:

    su backuppc
    ssh-keygen -t rsa
    as I thought that by copying the .ssh folder of working vaio I would be able to skip this step all together as everything would be the same bar the IP address. I can ssh fine from server -> vaio and vaio -> server and the output of:

    ssh -l root whoami
    is root

    What's going wrong?
  6. lordshadow

    lordshadow New Member

    Finally I managed to figurure out the ssh issue!

    sudo -u backuppc /usr/share/backuppc/bin/BackupPC_dump -v -f backupclient

    then it ask me to add the host fingerprints so that was fine :D - Few


    Now with regards to my localhost I added backuppc to group root however still no change in terms of backing up /etc dir so permissions still aren't good for user backuppc :(
  7. lordshadow

    lordshadow New Member

    I just ahd a thought!

    For my localhost; what would the significance of changing the PATH have?

    Currently echo $PATH shows:

    so if I added: $PATH=$PATH:/ would this help resolve the issue?
  8. lordshadow

    lordshadow New Member

    Ok wow now I managed to backup my localhost aswell! :D

    I found this site just this morning:

    Then checking out the file in the /etc/backuppc directory

    we have a line:

    $Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C $tarPath -c -v -f - -C $shareName'                        . ' --totals';
    and all we need to do is a slight modification

    $Conf{TarClientCmd} = '/usr/bin/sudo $tarPath -c -v -f - -C $shareName+ --totals';
    then run this command:
    and add
    backuppc ALL = NOPASSWD: /bin/tar
    in there and then restart backuppc!

    Note that for localhost tar is used and not rsync or ssh, this is done because ssh and rsync are designed to work with remote machines rather then local ones as then you need to setup an RSA key pair to the same machine which is kind of pointless.

    So majority of problems solved, now if I could only figure out why the backuppc root dir won't move?

Share This Page