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
 
(One intermediate revision by the same user not shown)
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:
Line 11: Line 28:
# 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-tue
22              00             *                       *               1-5    root    /usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 0
00     20      *               *     1-4        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 fri
22              00             *                       *               6     root    /usr/share/backuppc/bin/BackupPC_serverMesg backup ip.address hostname backuppc 1
00     20      *               *      5          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



Latest revision as of 12:34, 4 January 2012

  • 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:
cat | sudo tee /etc/cron.d/backuppc > /dev/null <<EOFile
#
# 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-tue
00      20      *               *      1-4        backuppc /usr/local/sbin/BackupPcBackup 0 > /dev/null
# Full backup fri
00      20      *               *      5          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