The Subversion Extension is a Cedar Backup extension used to back up Subversion [31] version control repositories via the Cedar Backup command line. It is intended to be run either immediately before or immediately after the standard collect action.
Each configured Subversion repository can be backed using the same collect modes allowed for filesystems in the standard Cedar Backup collect action (weekly, daily, incremental) and the output can be compressed using either gzip or bzip2.
There are two different kinds of Subversion repositories at this writing: BDB (Berkeley Database) and FSFS (a "filesystem within a filesystem"). This extension backs up both kinds of repositories in the same way, using svnadmin dump in an incremental mode. It turns out that FSFS repositories can also be backed up just like any other filesystem directory. If you would rather do the backup that way, then use the normal collect action rather than this extension. If you decide to do that, be sure to consult the Subversion documentation and make sure you understand the limitations of this kind of backup. [32]
To enable this extension, add the following section to the Cedar Backup configuration file:
<extensions> <action> <name>subversion</name> <module>CedarBackup2.extend.subversion</module> <function>executeAction</function> <index>99</index> </action> </extensions>
This extension relies on the options and collect configuration
sections in the standard Cedar Backup configuration file, and then
also requires its own subversion
configuration
section. This is an example Subversion configuration section:
<subversion> <collect_mode>incr</collect_mode> <compress_mode>bzip2</compress_mode> <repository> <type>FSFS</type> <abs_path>/opt/public/svn/software</abs_path> <collect_mode>daily</collect_mode> </repository> <repository> <type>FSFS</type> <abs_path>/opt/public/svn/docs</abs_path> </repository> <repository> <type>BDB</type> <abs_path>/opt/public/svn/web</abs_path> <compress_mode>gzip</compress_mode> </repository> </subversion>
The following elements are part of the Subversion configuration section:
collect_mode
Default collect mode.
The collect mode describes how frequently a Subversion repository is backed up. The Subversion extension recognizes the same collect modes as the standard Cedar Backup collect action (see Chapter 2, Basic Concepts).
This value is the collect mode that will be used by default during the backup process. Individual repositories (below) may override this value. If all individual repositories provide their own value, then this default value may be omitted from configuration.
Note: if your backup device does not suppport multisession
discs, then you should probably use the
daily
collect mode to avoid losing
data.
Restrictions: Must be one of
daily
, weekly
or
incr
.
compress_mode
Default compress mode.
Subversion repositories backups are just specially-formatted text files, and often compress quite well using gzip or bzip2. The compress mode describes how the backed-up data will be compressed, if at all.
This value is the compress mode that will be used by default during the backup process. Individual repositories (below) may override this value. If all individual repositories provide their own value, then this default value may be omitted from configuration.
Restrictions: Must be one of
none
, gzip
or
bzip2
.
repository
A Subversion repository be collected.
This is a subsection which contains information about a specific Subversion repository to be backed up.
This section can be repeated as many times as is necessary. At least one repository directory must be configured.
The repository subsection contains the following fields:
type
Repository type for this repository.
The repository type indicates what kind of Subversion repository backend is in use. The Subversion extension recognizes two kinds of backends: BDB and FSFS, as described above.
This field is optional. If it doesn't exist, the backup will assume the BDB type.
Restrictions: Must be one of
BDB
or FSFS
.
collect_mode
Collect mode for this repository.
This field is optional. If it doesn't exist, the backup will use the default collect mode.
Restrictions: Must be one of
daily
, weekly
or
incr
.
compress_mode
Compress mode for this repository.
This field is optional. If it doesn't exist, the backup will use the default compress mode.
Restrictions: Must be one of
none
, gzip
or
bzip2
.
abs_path
Absolute path of the Subversion repository to back up.
Restrictions: Must be an absolute path.
[31] See http://subversion.org
[32] For instance, see the “Backups” section on this page: http://freehackers.org/~shlomif/svn-raweb-light/subversion.cgi/trunk/notes/fsfs