Schedulazione di backup con BackupPC: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
m New page: * Disabilitare la schedulazione interna di backuppc: sudoedit /etc/backuppc/config.pl $Conf{BackupsDisable} = 1; * Impostare il file di contab: <pre> cat | sudo tee /etc/cron.d/backup...
 
mNo edit summary
Line 3: Line 3:


  $Conf{BackupsDisable} = 1;
  $Conf{BackupsDisable} = 1;
* Creare lo script di backup che elenca le macchine da bacckupare:
sudoedit /usr/local/sbin/BackupPcBackup
<pre>
#!/bin/bash
TYPE=$1
# TYPE=0 Incremental
# TYPE=1 Full
/usr/share/backuppc/bin/BackupPC_serverMesg backup 1.2.3.4  myclient1  backuppc $TYPE
/usr/share/backuppc/bin/BackupPC_serverMesg backup 5.6.7.8  myclient2  backuppc $TYPE
</pre>
* Renderlo eseguibile:
sudo chmod +x /usr/local/sbin/BackupPcBackup


* Impostare il file di contab:
* Impostare il file di contab:


<pre>
<pre>
cat | sudo tee /etc/cron.d/backuppc > /dev/null <<EOFile
#
#
# Regular cron jobs for backuppc
# Regular cron jobs for backuppc
#
#
#hour   minute  DayOfMonth      Month  DayOfWeek      user   command
#min    hours   DayOfMonth      Month  DayOfWeek      user           command
# check if backuppc is up and running
# Check if backuppc is running
*              00              *                      *              *      root    /usr/share/backuppc/bin/BackupPC_sendEmail -c
00              *              *                      *              *      backuppc /usr/share/backuppc/bin/BackupPC_sendEmail -c > /dev/null
# Run incremental backup of machine name hostname with ip address ip.address as user backuppc from Mon to Fri at 22:00
# Incr backup mon-fri
22             00             *                      *              1-5    root    /usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 0
00             22              *                      *              1-5    backuppc /usr/local/sbin/BackupPcBackup 0 > /dev/null
# Run full backup of machine name hostname with ip address ip.address as user backuppc at Sat at 22:00
# Full backup sat
22             00             *                      *              6      root    /usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 1
00             22              *                      *              6      backuppc /usr/local/sbin/BackupPcBackup 1 > /dev/null
EOFile
EOFile
</pre>
</pre>


* Testare con
* Testare manualmente con
  sudo -u backuppc usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 0
  sudo -u backuppc /usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 0
  sudo -u backuppc  /usr/share/backuppc/bin/BackupPC_serverMesg status jobs
  sudo -u backuppc  /usr/share/backuppc/bin/BackupPC_serverMesg status jobs



Revision as of 12:26, 30 December 2011

  • Disabilitare la schedulazione interna di backuppc:
sudoedit /etc/backuppc/config.pl
$Conf{BackupsDisable} = 1;
  • Creare lo script di backup che elenca le macchine da bacckupare:
sudoedit /usr/local/sbin/BackupPcBackup
#!/bin/bash
TYPE=$1
# TYPE=0 Incremental
# TYPE=1 Full
/usr/share/backuppc/bin/BackupPC_serverMesg backup 1.2.3.4  myclient1  backuppc $TYPE
/usr/share/backuppc/bin/BackupPC_serverMesg backup 5.6.7.8  myclient2   backuppc $TYPE
  • Renderlo eseguibile:
sudo chmod +x /usr/local/sbin/BackupPcBackup


  • Impostare il file di contab:
#
# Regular cron jobs for backuppc
#
#min    hours   DayOfMonth      Month   DayOfWeek       user            command
# Check if backuppc is running
00              *               *                       *               *      backuppc /usr/share/backuppc/bin/BackupPC_sendEmail -c > /dev/null
# Incr backup mon-fri
00              22              *                       *               1-5    backuppc /usr/local/sbin/BackupPcBackup 0 > /dev/null
# Full backup sat
00              22              *                       *               6      backuppc /usr/local/sbin/BackupPcBackup 1 > /dev/null
EOFile
  • Testare manualmente con
sudo -u backuppc /usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 0
sudo -u backuppc  /usr/share/backuppc/bin/BackupPC_serverMesg status jobs

Riferimenti