Creación de backup

De WikiEtl
Saltar a: navegación, buscar

BackupPC Introduction

This documentation describes BackupPC version 2.1.1, released on 13 Mar 2005.


BackupPC is a high-performance, enterprise-grade system for backing up Unix, Linux and WinXX PCs, desktops and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.

Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server's local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.

Features include:

   * A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PC are stored only once (using hard links), resulting in substantial savings in disk storage and disk writes.
   * Optional compression provides additional reductions in storage (around 40%). The CPU impact of compression is low since only new files (those not already in the pool) need to be compressed.
   * A powerful http/cgi user interface allows administrators to view log files, configuration, current status and allows users to initiate and cancel backups and browse and restore files from backups.
   * The http/cgi user interface has internationalization (i18n) support, currently providing English, French, German, Spanish, Italian and Dutch.
   * No client-side software is needed. On WinXX the standard smb protocol is used to extract backup data. On linux or unix clients, rsync or tar (over ssh/rsh/nfs) is used to extract backup data. Alternatively, rsync can also be used on WinXX (using cygwin), and Samba could be installed on the linux or unix client to provide smb shares).
   * Flexible restore options. Single files can be downloaded from any backup directly from the CGI interface. Zip or Tar archives for selected files or directories from any backup can also be downloaded from the CGI interface. Finally, direct restore to the client machine (using smb or tar) for selected files or directories is also supported from the CGI interface.
   * BackupPC supports mobile environments where laptops are only intermittently connected to the network and have dynamic IP addresses (DHCP). Configuration settings allow machines connected via slower WAN connections (eg: dial up, DSL, cable) to not be backed up, even if they use the same fixed or dynamic IP address as when they are connected directly to the LAN.
   * Flexible configuration parameters allow multiple backups to be performed in parallel, specification of which shares to backup, which directories to backup or not backup, various schedules for full and incremental backups, schedules for email reminders to users and so on. Configuration parameters can be set system-wide or also on a per-PC basis.
   * Users are sent periodic email reminders if their PC has not recently been backed up. Email content, timing and policies are configurable.
   * BackupPC is Open Source software hosted by SourceForge.

Backup basics

Full Backup

   A full backup is a complete backup of a share. BackupPC can be configured to do a full backup at a regular interval (typically weekly). BackupPC can be configured to keep a certain number of full backups. Exponential expiry is also supported, allowing full backups with various vintages to be kept (for example, a settable number of most recent weekly fulls, plus a settable number of older fulls that are 2, 4, 8, or 16 weeks apart). 

Incremental Backup

   An incremental backup is a backup of files that have changed (based on their modification time) since the last successful full backup. For SMB and tar, BackupPC backups all files that have changed since one hour prior to the start of the last successful full backup. Rsync is more clever: any files whose attributes have changed (ie: uid, gid, mtime, modes, size) since the last full are backed up. Deleted, new files and renamed files are detected by Rsync incrementals. In constrast, SMB and tar incrementals are not able to detect deleted files, renamed files or new files whose modification time is prior to the last full dump. 
   BackupPC can also be configured to keep a certain number of incremental backups, and to keep a smaller number of very old incremental backups. (BackupPC does not support multi-level incremental backups, although it will in a future version.)
   BackupPC's CGI interface ``fills-in incremental backups based on the last full backup, giving every backup a ``full appearance. This makes browsing and restoring backups easier.

Partial Backup

   When a full backup fails or is canceled, and some files have already been backed up, BackupPC keeps a partial backup containing just the files that were backed up successfully. The partial backup is removed when the next successful backup completes, or if another full backup fails resulting in a newer partial backup. A failed full backup that has not backed up any files, or any failed incremental backup, is removed; no partial backup is saved in these cases. 
   The partial backup may be browsed or used to restore files just like a successful full or incremental backup.
   With the rsync transfer method the partial backup is used to resume the next full backup, avoiding the need to retransfer the file data already in the partial backup.

Identical Files

   BackupPC pools identical files using hardlinks. By ``identical files we mean files with identical contents, not necessary the same permissions, ownership or modification time. Two files might have different permissions, ownership, or modification time but will still be pooled whenever the contents are identical. This is possible since BackupPC stores the file meta-data (permissions, ownership, and modification time) separately from the file contents. 

Backup Policy

   Based on your site's requirements you need to decide what your backup policy is. BackupPC is not designed to provide exact re-imaging of failed disks. See Limitations for more information. However, the addition of tar transport for linux/unix clients, plus full support for special file types and unix attributes in v1.4.0 likely means an exact image of a linux/unix file system can be made. 
   BackupPC saves backups onto disk. Because of pooling you can relatively economically keep several weeks of old backups.
   At some sites the disk-based backup will be adequate, without a secondary tape backup. This system is robust to any single failure: if a client disk fails or loses files, the BackupPC server can be used to restore files. If the server disk fails, BackupPC can be restarted on a fresh file system, and create new backups from the clients. The chance of the server disk failing can be made very small by spending more money on increasingly better RAID systems. However, there is still the risk of catastrophic events like fires or earthquakes that can destroy both the BackupPC server and the clients it is backing up if they are physically nearby.
   Some sites might choose to do periodic backups to tape or cd/dvd. This backup can be done perhaps weekly using the archive function of BackupPC.
   Other users have reported success with removable disks to rotate the BackupPC data drives, or using rsync to mirror the BackupPC data pool offsite.


BackupPC home page

   The BackupPC Open Source project is hosted on SourceForge. The home page can be found at:
   This page has links to the current documentation, the SourceForge project page and general information.

SourceForge project

   The SourceForge project page is at:
   This page has links to the current releases of BackupPC.

BackupPC FAQ

   BackupPC has a FAQ at 

Mail lists

   Three BackupPC mailing lists exist for announcements (backuppc-announce), developers (backuppc-devel), and a general user list for support, asking questions or any other topic relevant to BackupPC (backuppc-users). 
   The lists are archived on SourceForge and Gmane. The SourceForge lists are not always up to date and the searching is limited, so Gmane is a good alternative. See:
   You can subscribe to these lists by visiting:
   The backuppc-announce list is moderated and is used only for important announcements (eg: new versions). It is low traffic. You only need to subscribe to one of backuppc-announce and backuppc-users: backuppc-users also receives any messages on backuppc-announce.
   The backuppc-devel list is only for developers who are working on BackupPC. Do not post questions or support requests there. But detailed technical discussions should happen on this list.
   To post a message to the backuppc-users list, send an email to
   Do not send subscription requests to this address!

Other Programs of Interest

   If you want to mirror linux or unix files or directories to a remote server you should consider rsync, BackupPC now uses rsync as a transport mechanism; if you are already an rsync user you can think of BackupPC as adding efficient storage (compression and pooling) and a convenient user interface to rsync. 
   Unison is a utility that can do two-way, interactive, synchronization. See
   Three popular open source packages that do tape backup are Amanda (, afbackup (, and Bacula ( Amanda can also backup WinXX machines to tape using samba. These packages can be used as back ends to BackupPC to backup the BackupPC server data to tape.
   Various programs and scripts use rsync to provide hardlinked backups. See, for example, Mike Rubel's site (, JW Schultz's dirvish (, Ben Escoto's rdiff-backup (, and John Bowman's rlbackup (
   BackupPC provides many additional features, such as compressed storage, hardlinking any matching files (rather than just files with the same name), and storing special files without root privileges. But these other scripts provide simple and effective solutions and are worthy of consideration.

Road map

The new features planned for future releases of BackupPC are at

Comments and suggestions are welcome.

Typically this is set slightly less than an integer number of days. The time taken for the backup, plus the granularity of $Conf{WakeupSchedule} will make the actual backup interval a bit longer.


After running, browse through the config file, /usr/share/backuppc/conf/, and make sure all the default settings are correct. In particular, you will need to decide whether to use smb, tar or rsync transport (or whether to set it on a per-PC basis) and set the relevant parameters for that transport method. See the section Client Setup for more details.

$Conf{FullKeepCnt} = 1;

   Number of full backups to keep. Must be >= 1. 
   In the steady state, each time a full backup completes successfully the oldest one is removed. If this number is decreased, the extra old backups will be removed.
   If filling of incremental dumps is off the oldest backup always has to be a full (ie: filled) dump. This might mean one or two extra full dumps are kept until the oldest incremental backups expire.
   Exponential backup expiry is also supported. This allows you to specify:
    - num fulls to keep at intervals of 1 * $Conf{FullPeriod}, followed by
    - num fulls to keep at intervals of 2 * $Conf{FullPeriod},
    - num fulls to keep at intervals of 4 * $Conf{FullPeriod},
    - num fulls to keep at intervals of 8 * $Conf{FullPeriod},
    - num fulls to keep at intervals of 16 * $Conf{FullPeriod},
   and so on. This works by deleting every other full as each expiry boundary is crossed.
   Exponential expiry is specified using an array for $Conf{FullKeepCnt}:
    $Conf{FullKeepCnt} = [4, 2, 3];
   Entry #n specifies how many fulls to keep at an interval of 2^n * $Conf{FullPeriod} (ie: 1, 2, 4, 8, 16, 32, ...).
   The example above specifies keeping 4 of the most recent full backups (1 week interval) two full backups at 2 week intervals, and 3 full backups at 4 week intervals, eg:
   full 0 19 weeks old \
   full 1 15 weeks old >--- 3 backups at 4 * $Conf{FullPeriod}
   full 2 11 weeks old /
   full 3 7 weeks old \____ 2 backups at 2 * $Conf{FullPeriod}
   full 4 5 weeks old /
   full 5 3 weeks old \
   full 6 2 weeks old \___ 4 backups at 1 * $Conf{FullPeriod}
   full 7 1 week old /
   full 8 current /
   On a given week the spacing might be less than shown as each backup ages through each expiry period. For example, one week later, a new full is completed and the oldest is deleted, giving:

$Conf{BackupFilesExclude} = undef;

   List of directories or files to exclude from the backup. For Smb, only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly} can be specified per share. If both are set for a particular share, then $Conf{BackupFilesOnly} takes precedence and $Conf{BackupFilesExclude} is ignored. 
   This can be set to a string, an array of strings, or, in the case of multiple shares, a hash of strings or arrays. A hash is used to give a list of directories or files to exclude for each share (the share name is the key). If this is set to just a string or array, and $Conf{SmbShareName} contains multiple share names, then the setting is assumed to apply to all shares.
   The exact behavior is determined by the underlying transport program, smbclient or tar. For smbclient the exlclude file list is passed into the X option. Simple shell wild-cards using ``* or ``? are allowed.
   For tar, if the exclude file contains a ``/ it is assumed to be anchored at the start of the string. Since all the tar paths start with ``./, BackupPC prepends a ``. if the exclude file starts with a ``/. Note that GNU tar version >= 1.13.7 is required for the exclude option to work correctly. For linux or unix machines you should add ``/proc to $Conf{BackupFilesExclude} unless you have specified --one-file-system in $Conf{TarClientCmd} or --one-file-system in $Conf{RsyncArgs}. Also, for tar, do not use a trailing ``/ in the directory name: a trailing ``/ causes the name to not match and the directory will not be excluded.
   Users report that for smbclient you should specify a directory followed by ``/*, eg: ``/proc/*, instead of just ``/proc.
   $Conf{BackupFilesExclude} = {
   'var' => ['home','autofs','mqueue*','snort'],
   'home' => ['autofs','mqueue*'],
   'usr' => ['lab', 'mqueue*', 'squid'], };
   Equipo de Técnicos de Laboratorio
   26 Enero 2006