Menü Schließen

Debian BackupPC from Source installieren

BackupPC Logo

Nachfolgend eine Anleitung wie ich BackupPC in Debian vom Source installiert habe. Hintergrund warum ich nicht die Debian Paketquellen verwende ist die Aktualität der Pakete. Sowohl für das aktuelle Debian stable 10 Buster als auch für testing 11 Bullseye ist die Version von BackupPC die 3.3.2, aus dem Jahr 2017! Aktuell veröffentlicht ist jedoch die Version 4.4.0!

Update

  • 19.07.2020 – Howto auf Backup Version 4.4.0 aktualisiert

Was ist BackupPC?

BackupPC ist eine Open Source Lösung für die Datensicherung von Festplatte auf Festplatten oder wie es auf der Webseite steht:

BackupPC is a high-performance, enterprise-grade system for backing up Linux, Windows and macOS PCs and laptops to a server’s disk. BackupPC is highly configurable and easy to install and maintain.

https://backuppc.github.io/backuppc/

Zu den Features zählen:

  • ein Webinterface für die Administration von BackupPC zum Konfigurieren, Sichern und Wiederherstellen von Backups, durchsuchen von Backups und auswerten der Logs
  • Data deduplication / Deduplikation – überprüft Backups von selben und anderen Clients auf doppelte Daten und sichert sie nur einmal, wodurch Backupspeicher und Disk I/O reduziert wird
  • unterstützt DatenKompression von Dateien beim Backup
  • es wird keine clientseitige Software / Agent benötigt – für Windows wird SMB und unter Linux tar über ssh, rsh, nfs
  • unterstützt mobile Clients wie Notebooks selbst wenn sie nur sporadisch per DHCP mit dem Netzwerk verbunden sind
  • umfangreiche Planung von Full und Incremental Backups mit paralleler Ausführung auf unterschiedlichen Storage möglich
  • gibt per E-Mail einen Reminder, wenn ein Gerät länger nicht gesichert wurde

BackupPC auf Debian installieren

Ich habe Debian 10 Buster (netinstall) installiert und werde nun BackupPC in der aktuellen Version 4.4.0 installieren. Die Änderungen sind hier zu finden: https://www.taste-of-it.de/backuppc-4-3-2-bugfix-release-erschienen/

Ein super Script für die Installation ist unter: https://github.com/backuppc/backuppc/wiki/Installing-BackupPC-4-from-tarball-or-git-on-Ubuntu zu finden. Ich habe es hier mal als Download:

# touch /root/password #<- falls sie beim ersten Installationsversuch als fehlend gemeldet wird
# cd /home/
# wget https://www.taste-of-it.de/wp-content/uploads/2020/03/backuppc_4-4_install.zip
# unzip backuppc_4-4_install.zip
# chmod +x backuppc_4-4_install.sh
# chmod 755 backuppc_4-4_install.sh
# /.backuppc_4-4_install.sh
Ok, it looks like we are finished.  There are several more things you
will need to do:

  - Browse through the config file, /etc/BackupPC/config.pl,
    and make sure all the settings are correct.  In particular,
    you will need to set $Conf{CgiAdminUsers} so you have
    administration privileges in the CGI interface.

  - Edit the list of hosts to backup in /etc/BackupPC/hosts.

  - Read the documentation in /usr/local/BackupPC/doc/BackupPC.html.
    Please pay special attention to the security section.

  - Verify that the CGI script BackupPC_Admin runs correctly.  You might
    need to change the permissions or group ownership of BackupPC_Admin.
    If this is an upgrade and you are using mod_perl, you will need
    to restart Apache.  Otherwise it will have stale code.

  - BackupPC should be ready to start.  Don't forget to run it
    as user backuppc!  The installation also contains
    a systemd/backuppc.service script that can be installed so
    that BackupPC can auto-start on boot.  This will also enable
    administrative users to start the server from the CGI interface.
    See systemd/README.

Enjoy!
Enabling conf backuppc.
To activate the new configuration, you need to run:
  systemctl reload apache2
Enabling module cgid.
To activate the new configuration, you need to run:
  systemctl restart apache2
Adding password for user backuppc

Nun die Konfiguration von BackupPC anpassen:

# nano /etc/BackupPC/config.pl
-> $Conf{ServerHost} = '<hostname>'
weitere Einstellungen entsprechend anpassen oder im Webinterface vornehmen.

Damit ist die Installation von BackupPC erledigt und die WebGUI kann aufgerufen werden. “http://<servername>/BackupPC_Admin”. Dort kann die weitere Konfiguration und die Einrichtung von Backupjobs erfolgen.

Das Handbuch ab Version 4: https://backuppc.github.io/backuppc/BackupPC.html

BackupPC Apache user Passwort ändern

Das Passwort soll während der Installation abgefragt werden. Bei mir, mit dem Installerscript 4.4.0 war dies nicht der Fall, also neu setzen:

# htpasswd  /etc/BackupPC/BackupPC.users backuppc
New password:
Re-type new password:
Updating password for user backuppc

Fehler Forbidden You don’t have permission to access this resource.

Kontrolle ob Apache und BackupPC als user backuppc laufen:

# ps -aux |grep -i backuppc
backuppc 30126  0.0  1.1  22256 11596 ?        S    00:03   0:00 /usr/bin/perl /usr/local/BackupPC/bin/BackupPC -d
backuppc 30256  0.0  0.5  17340  5740 ?        S    00:16   0:00 /usr/sbin/apache2 -k start
backuppc 30257  0.0  0.9 763700  9124 ?        Sl   00:16   0:00 /usr/sbin/apache2 -k start
backuppc 30258  0.0  0.9 763636  9124 ?        Sl   00:16   0:00 /usr/sbin/apache2 -k start

Kontrolle ob die Datei- und Verzeichnisberechtigungen stimmen:

# ls -ahls /var/www/cgi-bin/BackupPC/BackupPC_Admin
4,0K -r-xr-xr-- 1 backuppc backuppc 3,9K Mär 12 00:02 /var/www/cgi-bin/BackupPC/BackupPC_Admin

# ls -ahls /var/www/html/BackupPC/
insgesamt 212K
4,0K drwxr-xr-x 2 backuppc backuppc 4,0K Mär 12 00:02 .
4,0K drwxr-xr-x 3 root     root     4,0K Mär 12 00:02 ..
4,0K -r--r--r-- 1 backuppc backuppc   52 Mär 12 00:02 0000000.gif
4,0K -r--r--r-- 1 backuppc backuppc   55 Mär 12 00:02 0000011.gif
....

Kontrolle der Apache Konfiguration:

# cat /etc/apache2/conf-enabled/backuppc.conf

# Apache 2.2
<IfModule !authz_core_module>
  Deny from all
  Allow from 127.0.0.1
  Require valid-user
</IfModule>
# Apache 2.4+
<IfModule authz_core_module>
  <RequireAll>
    Require local
    Require valid-user
  </RequireAll>
</IfModule>

AuthType Basic
AuthUserFile /etc/BackupPC/BackupPC.users
AuthName "BackupPC Community Edition Administrative Interface"

</Directory>

Alias           /BackupPC         /var/www/html/BackupPC
ScriptAlias     /BackupPC_Admin         /var/www/cgi-bin/BackupPC/BackupPC_Admin

Die Lösung war die Anpassung der Apache Konfiguration

# nano/etc/apache2/conf-enabled/backuppc.conf
AuthUserFile /etc/BackupPC/BackupPC.users
AuthName "BackupPC Community Edition Administrative Interface"
require valid-user # <-- hier hinzufügen

Have Fun…

2 Kommentare

  1. Pingback:BackupPC – Windows ACL behalten – TASTE-OF-IT

Schreibe einen Kommentar zu Thomas Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert