Installazione e Configurazione di BackupPc: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
Line 179: Line 179:


Sul server da backuppare, aggiungere questa chiave per l'utente
Sul server da backuppare, aggiungere questa chiave per l'utente
<pre>
$ cat /tmp/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
diesis@berserver ~
$ cat /tmp/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys


Controllare che l'utente backuppc possa loggarsi via ssh senza password su server da backuppare
Controllare che l'utente backuppc possa loggarsi via ssh senza password su server da backuppare

Revision as of 16:12, 23 February 2009

Attenzione questo articolo è ancora incompleto.
Sentiti libero di contribuire cliccando sul tasto edit.

Installazione

sudo apt-get install backuppc rsync libfile-rsyncp-perl par2 smbfs apache2

Cambiare la password di default per l'accesso a backuppc:

sudo htpasswd /etc/backuppc/htpasswd backuppc

Se installa anche apache, rimuoverlo:

sudo apt-get remove --purge apache apache-common
sudo rm -rf /etc/apache

Installare il file di configurazione di backuppc in apache2

cd /etc/apache2/sites-available/
sudo ln -s /etc/backuppc/apache.conf backuppc
sudo touch /etc/apache2/httpd.conf

Attivare la configurazione

sudo a2ensite backuppc

Impostare l'autostart di apache2

cat | sudo tee /etc/default/apache2 > /dev/null <<EOFile
# 0 = start on boot; 1 = don't start on boot
NO_START=0
EOFile

Riavviare apache 2

sudo /etc/init.d/apache2 restart

Testare apache2

Testare backuppc

  • Loggarsi con backuppc/password_impostata http://fireber/backuppc (attivare javascript !!!)
  • Lanciare un backup di localhost dall'interfaccia

Configurazione BackuPC

Cambiare i seguenti parametri:

sudoedit /etc/backuppc/config.pl
$Conf{Language} = 'it';

Configurazione del backup di un host via ssh

Inserire il nome del pc da backuppare:

echo berserver   1       backuppc | sudo tee -a /etc/backuppc/hosts > /dev/null

Creare il file di configurazione scegliendo cosa backuppare:

cat | sudo tee /etc/backuppc/berserver.pl < /dev/null <<'EOFile'
#
# Rsync over ssh Backup
#
# Minimum period in days between full and incremental backups:
# 1 Full alla settimana
$Conf{FullPeriod} = 6.97;
# 2 o almeno un incr al giorno
$Conf{IncrPeriod} = 0.24;

# Number of full and incremental backups to keep:
$Conf{FullKeepCnt} = 2;
$Conf{IncrKeepCnt} = 12;
# Note that additional fulls will be kept for as long as is necessary
# to support remaining incrementals.

# What transport to use backup the client [smb|rsync|rsyncd|tar|archive]:
$Conf{XferMethod} = 'rsync';

# The file system path or the name of the rsyncd module to backup when
# using rsync/rsyncd:
#Conf{RsyncShareName} = '/home/diesis';
$Conf{RsyncShareName} = '/';

# If this is defined only these files/paths will be included in the backup:
#$Conf{BackupFilesOnly} = undef;
$Conf{BackupFilesOnly} = ['/mnt/f/Apps/Symphony',
                          '/mnt/c/tmp'];

# These files/paths will be excluded from the backup:
$Conf{BackupFilesExclude} = ['/home/diesis/.cxoffice/win98/drive_c/Windows/Temporary Internet Files/Content.IE5',
                        '/home/diesis/.thumbnails',
                        '/home/diesis/core.*',
                        '/home/diesis/.core*',
                        '/home/diesis/.Trash',
                        '/home/diesis/.ies4linux',
                        '/home/diesis/.evolution/cache/http',
                        '/home/diesis/.evolution/cache/tmp',
                        '/home/diesis/.evolution/mail/imap/*/folders',
                        '/home/diesis/.evolution/mail/imap4/*/folders',
                        '/home/diesis/.evolution/mail/nntp/*/cache',
                        '/home/diesis/.opensync/group?/?/enginepipe',
                        '/home/diesis/.opensync/group?/?/pluginpipe'];
#
#$Conf{BackupFilesExclude} = ['/proc',
#                       '/dev',
#                       '/cdrom',
#                       '/floppy',
#                       '/mnt',
#                       '/var/lib/backuppc',
#                       '/lost+found',
#                       '/media/hda4/Install',
#                       '/media/hda4/Recycled',
#                       '/home/diesis/.cxoffice/win98/drive_c/Windows/Temporary Internet Files/Content.IE5',
#                       '/home/diesis/.thumbnails',
#                       '/home/diesis/core.*',
#                       '/home/diesis/.core*',
#                       '/home/diesis/.Trash',
#                       '/home/diesis/.ies4linux',
#                       '/home/diesis/.evolution/cache/http',
#                       '/home/diesis/.evolution/cache/tmp',
#                       '/home/diesis/.evolution/mail/imap/*/folders',
#                       '/home/diesis/.evolution/mail/imap4/*/folders',
#                       '/home/diesis/.evolution/mail/nntp/*/cache',
#                       '/home/diesis/.opensync/group?/?/enginepipe',
#                       '/home/diesis/.opensync/group?/?/pluginpipe'];

# Level of verbosity in Xfer log files:
$Conf{XferLogLevel} = 1;

# Commands to run for client backups:
# Note the use of SSH's -C attribute. This enables compression in SSH.
$Conf{RsyncClientCmd} = '$sshPath -C -x -l administrator -o PreferredAuthentications=publickey $host $rsyncPath $argList+';

# Commands to run for client direct restores:
# Note the use of SSH's -C attribute. This enables compression in SSH.
$Conf{RsyncClientRestoreCmd} = '$sshPath -C -q -x -l administrator $host $rsyncPath $argList+';

# Compression level to use on files. 0 means no compression. See notes
# in main config file before changing after backups have already been done.
$Conf{CompressLevel} = 3;

# The backup may occur over vpn. Avoid "ping too slow" errors.
$Conf{PingMaxMsec} = 150;

# Timeout if backing up large files ?
$Conf{ClientTimeout} = 3600*8;      # 6 Hours!!
EOFile
sudo chown backuppc\: /etc/backuppc/berserver.pl
sudo chmod o= /etc/backuppc/berserver.pl

Riavviare backuppc

sudo /etc/init.d/backupp restart

Controllare via web che l'host sia presente

Configurazione dell'accesso ssh sulla macchina da backuppare

Creare la chiave privata di backuppc sul server backuppc

sudo su backuppc
ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/backuppc/.ssh/id_rsa): <-- <ENTER>
Created directory '/var/lib/backuppc/.ssh'.
Enter passphrase (empty for no passphrase): <-- <ENTER>
Enter same passphrase again: <-- <ENTER>
Your identification has been saved in /var/lib/backuppc/.ssh/id_rsa.
Your public key has been saved in /var/lib/backuppc/.ssh/id_rsa.pub.
The key fingerprint is:
74:20:65:73:47:1c:cb:ba:5d:9b:5d:56:cf:91:1a:1a backuppc@server1.example.com

Copiare /var/lib/backuppc/.ssh/id_rsa.pub sul server da backuppare

sudo cp /var/lib/backuppc/.ssh/id_rsa.pub /tmp
scp /tmp/id_rsa.pub berserver:/tmp


Sul server da backuppare, aggiungere questa chiave per l'utente

$ cat /tmp/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys

Controllare che l'utente backuppc possa loggarsi via ssh senza password su server da backuppare

mnt.vvngrl@fireber:/tmp$ sudo -u backuppc ssh root@berserver
The authenticity of host 'berserver (192.168.0.100)' can't be established.
RSA key fingerprint is 2c:b3:8f:b4:2f:1e:e2:26:4b:d0:3b:34:01:69:79:51.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'berserver,192.168.0.100' (RSA) to the list of known hosts.
Last login: Thu Sep 20 11:14:42 2007 from rvmnot003

Administrator@berserver ~
$ exit
logout
Connection to berserver closed.

Lanciare un backup di prova da commandline:

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

Configurazione del backup di un host via Samba

Inserire il nome (netbios) del pc da backuppare:

echo rosnotcri   0       backuppc, cristina.rossi | sudo tee -a /etc/backuppc/hosts > /dev/null

Creare il file di configurazione scegliendo cosa backuppare:

cat | sudo tee /etc/backuppc/rosnotcri.pl < /dev/null <<'EOFile'
#
# SMB Backup
#
# Minimum period in days between full and incremental backups:
# 1 Full alla settimana
$Conf{FullPeriod} = 6.97;
# 2 o almeno un incr al giorno
$Conf{IncrPeriod} = 0.24;

# Number of full and incremental backups to keep:
$Conf{FullKeepCnt} = 2;
$Conf{IncrKeepCnt} = 12;
# Note that additional fulls will be kept for as long as is necessary
# to support remaining incrementals.

# What transport to use backup the client [smb|rsync|rsyncd|tar|archive]:
$Conf{XferMethod} = 'smb';
$Conf{SmbShareName} = [ 'C$', 'D$' ];
$Conf{SmbShareUserName} = 'administrator';
$Conf{SmbSharePasswd} = 'lapassword';

# If this is defined only these files/paths will be included in the backup:
#$Conf{BackupFilesOnly} = undef;
#
$Conf{BackupFilesOnly} = {
        'C$' => ['/Documents and Settings/cristina.rossi'],
        'D$' => ['/Documenti'],
                 };

# Level of verbosity in Xfer log files:
$Conf{XferLogLevel} = 1;

# Compression level to use on files. 0 means no compression. See notes
# in main config file before changing after backups have already been done.
$Conf{CompressLevel} = 3;

# The backup may occur over vpn. Avoid "ping too slow" errors.
$Conf{PingMaxMsec} = 150;

# Timeout if backing up large files ?
$Conf{ClientTimeout} = 3600*8;      # 6 Hours
EOFile

Cambiare le permission per nascondere le password

sudo chown backuppc\: /etc/backuppc/*.pl
sudo chmod o= /etc/backuppc/*.pl

Riavviare backuppc

sudo /etc/init.d/backupp restart

Controllare via web che l'host sia presente

Configurazione dell'accesso SAMBA sulla macchina da backuppare

  • Il tutto vale per Windows XP PROFESSIONAL. Per XP Home non va.
  • Assicurarsi di poter accedere con utente e password alle condivisoni
  • Se si usano C$ e D$, assicurarsi di aver disabilitato la "Condivisione files semplice" da "Strumenti - Opzioni Cartella - Visulizzazione - Impostazioni avanzate" di Explorer.

Lanciare un backup di prova da commandline:

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

Riferimenti