Backup locale con BackuPc: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
*Creare il file di configurazione: | *Creare il file di configurazione: | ||
sudoedit /etc/backuppc/myclient.pl | |||
<pre> | <pre> | ||
# Local server backup of / as user backuppc | # Local server backup of / as user backuppc | ||
# | # | ||
$Conf{XferMethod} = 'tar'; | $Conf{XferMethod} = 'tar'; | ||
$Conf{TarShareName} = ['/']; | $Conf{TarShareName} = [ | ||
'/', | |||
]; | |||
$Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C /usr/bin/sudo $tarPath --one-file-system -c -v -f - -C $shareName' | $Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C /usr/bin/sudo $tarPath --one-file-system -c -v -f - -C $shareName' | ||
. ' --totals'; | |||
# Please note the use of sudo and --one-file-system | # Please note the use of sudo and --one-file-system | ||
| Line 19: | Line 22: | ||
$Conf{TarFullArgs} = '$fileList'; | $Conf{TarFullArgs} = '$fileList'; | ||
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList'; | $Conf{TarIncrArgs} = '--newer=$incrDate $fileList'; | ||
# Minimum period in days between full and incremental backups: | # Minimum period in days between full and incremental backups: | ||
# 1 Full alla settimana | # 1 Full alla settimana | ||
$Conf{FullPeriod} = 6.97; | $Conf{FullPeriod} = 6.97; | ||
# 2 o almeno un incr al giorno | # 2 o almeno un incr al giorno | ||
$Conf{IncrPeriod} = 0. | $Conf{IncrPeriod} = 0.49; | ||
# Number of full and incremental backups to keep: | # Number of full and incremental backups to keep: | ||
$Conf{FullKeepCnt} = | $Conf{FullKeepCnt} = 12; | ||
$Conf{IncrKeepCnt} = | $Conf{IncrKeepCnt} = 93; | ||
# Level of verbosity in Xfer log files: | # Level of verbosity in Xfer log files: | ||
| Line 35: | Line 38: | ||
# Compression level to use on files. 0 means no compression. See notes | # Compression level to use on files. 0 means no compression. See notes | ||
# in main config file before changing after backups have already been done. | # in main config file before changing after backups have already been done. | ||
$Conf{CompressLevel} = | $Conf{CompressLevel} = 9; | ||
$Conf{BackupFilesExclude} = [ | |||
'/cdrom', | |||
'/dev', | |||
'/floppy', | |||
'/lost+found', | |||
'/mnt', | |||
'/proc', | |||
'/sys', | |||
'/var/lib/backuppc/cpool', | |||
'/var/lib/backuppc/log', | |||
'/var/lib/backuppc/pc', | |||
'/var/lib/backuppc/poll', | |||
'/var/lib/backuppc/trash', | |||
'/var/spool/squid', | |||
'/var/spool/squid3', | |||
]; | |||
</pre> | </pre> | ||
* Aggiungere l'host con il nome: | * Aggiungere l'host con il nome: | ||
cd /etc/backuppc | |||
echo "myclient 0 backup@example.com backuppc" | sudo tee -a /etc/backuppc/hosts > /dev/null | |||
* Sistemare le permission | |||
sudo chown backuppc:www-data myclient.pl | |||
sudo chmod 0640 myclient.pl | |||
* Rinominare il file dell'host | |||
sudo mv myclient.pl NOME.pl | |||
* Cambiarlo nel file hosts, insieme all'email di notifica | |||
sudoedit hosts | |||
NOME 0 EMAIL@example.com backuppc | |||
* Riavviare backuppc | |||
sudo invoke-rc.d backuppc restart | |||
* Abilitare l'utente backuppc ad eseguire sudo senza password | * Abilitare l'utente backuppc ad eseguire sudo senza password | ||
| Line 56: | Line 87: | ||
* Testare un backup locale | * Testare un backup locale | ||
sudo -u backuppc /usr/share/backuppc/bin/BackupPC_dump -v -f | sudo -u backuppc /usr/share/backuppc/bin/BackupPC_dump -v -f NOME | ||
==Riferimenti== | ==Riferimenti== | ||
*[http://backuppc.sourceforge.net/faq/localhost.htmlBackupPC FAQ: Backing up the localhost (BackupPC server)] | *[http://backuppc.sourceforge.net/faq/localhost.htmlBackupPC FAQ: Backing up the localhost (BackupPC server)] | ||
Latest revision as of 16:06, 23 May 2013
Si usa il metodo Tar locale, eseguito come root tramite sudo.
- Creare il file di configurazione:
sudoedit /etc/backuppc/myclient.pl
# Local server backup of / as user backuppc
#
$Conf{XferMethod} = 'tar';
$Conf{TarShareName} = [
'/',
];
$Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C /usr/bin/sudo $tarPath --one-file-system -c -v -f - -C $shareName'
. ' --totals';
# Please note the use of sudo and --one-file-system
# remove extra shell escapes ($fileList+ etc.) that are
# needed for remote backups but may break local ones
$Conf{TarFullArgs} = '$fileList';
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList';
# 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.49;
# Number of full and incremental backups to keep:
$Conf{FullKeepCnt} = 12;
$Conf{IncrKeepCnt} = 93;
# 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} = 9;
$Conf{BackupFilesExclude} = [
'/cdrom',
'/dev',
'/floppy',
'/lost+found',
'/mnt',
'/proc',
'/sys',
'/var/lib/backuppc/cpool',
'/var/lib/backuppc/log',
'/var/lib/backuppc/pc',
'/var/lib/backuppc/poll',
'/var/lib/backuppc/trash',
'/var/spool/squid',
'/var/spool/squid3',
];
- Aggiungere l'host con il nome:
cd /etc/backuppc echo "myclient 0 backup@example.com backuppc" | sudo tee -a /etc/backuppc/hosts > /dev/null
- Sistemare le permission
sudo chown backuppc:www-data myclient.pl sudo chmod 0640 myclient.pl
- Rinominare il file dell'host
sudo mv myclient.pl NOME.pl
- Cambiarlo nel file hosts, insieme all'email di notifica
sudoedit hosts NOME 0 EMAIL@example.com backuppc
- Riavviare backuppc
sudo invoke-rc.d backuppc restart
- Abilitare l'utente backuppc ad eseguire sudo senza password
sudo visudo
... backuppc ALL = NOPASSWD: /bin/tar ...
- Testare un backup locale
sudo -u backuppc /usr/share/backuppc/bin/BackupPC_dump -v -f NOME