Bacula 1.32 User's Guide | Chapter 21

Using Bacula to Improve Your System Security | Index | Installing and Configuring MySQL

# The Bootstrap File

The information in this chapter is provided so that you may either create your own bootstrap files, or so that you can edit a bootstrap file produced by Bacula. However, normally the bootstrap file will be automatically created for you during the restore command in the Console program, or by using a Write Bootstrap record in your Backup Jobs, and thus you will never need to know the details of this file.

The bootstrap file contains ASCII information that permits precise specification of what files should be restored.

## File Format

The general format of a bootstrap file is:

<keyword> = <value>

Where each keyword and the value specify which files to restore. More precisely the keyword and their values serve to limit which files will be restored and thus act as a filter. The absence of a keyword means that all records will be accepted.

Blank lines and lines beginning with a pound sign (#) in the bootstrap file are ignored.

There are keywords which permit filtering by Volume, Client, Job, FileIndex, Session Id, Session Time, ...

The more keywords that are specified, the more selective the specification of which files to restore will be. In fact, each keyword is ANDed with other keywords that may be present.

For example,

    Volume = Test-001
    VolSessionId = 1
    VolSessionTime = 108927638

directs the Storage daemon (or the bextract program) to restore only those files on Volume Test-001 AND having VolumeSessionId equal to one AND having VolumeSession time equal to 108927638.

The full set of permitted keywords presented in the order in which they are matched against the Volume records are:

Volume
  The value field specifies what Volume the following commands apply to. Each Volume specification becomes the current Volume, to which all the following commands apply until a new current Volume (if any) is specified. If the Volume name contains spaces, it should be enclosed in quotes.
VolFile
  The value is a file number, a list of file numbers, or a range of file numbers numbers to match on the current Volume. The file number represents the physical file on the Volume where the data is stored. For a tape volume, this record is used to position to the correct starting file, and once the tape is past the last specified file, reading will stop.
VolBlock
  The value is a block number, a list of block numbers, or a range of block numbers numbers to match on the current Volume. The block number represents the physical block on the Volume where the data is stored. This record is currently not used.
VolSessionTime
  The value specifies a Volume Session Time to be matched from the current volume.
VolSessionId
  The value specifies a VolSessionId, a list of volume session ids, or a range of volume session ids to be matched from the current Volume. Each VolSessionId and VolSessionTime pair corresponds to a unique Job that is backed up on the Volume.
*JobId
  The value specifies a JobId, list of JobIds, or range of JobIds to be selected from the current Volume. Note, the JobId may not be unique if you have multiple Directors, or if you have reinitialized your database. The JobId filter works only if you do not run multiple simultaneous jobs.
*Job
  The value specifies a Job name or list of Job names to be matched on the current Volume. The Job corresponds to a unique VolSessionId and VolSessionTime pair. However, the Job is perhaps a bit more readable by humans. Standard regular expressions (wildcards) may be used to match Job names. The Job filter works only if you do not run multiple simultaneous jobs.
*Client
  The value specifies a Client name or list of Clients to will be matched on the current Volume. Standard regular expressions (wildcards) may be used to match Client names. The Client filter works only if you do not run multiple simultaneous jobs.
FileIndex
  The value specifies a FileIndex, list of FileIndexes, or range of FileIndexes to be selected from the current Volume. Each file (data) stored on a Volume within a Session has a unique FileIndex. For each Session, the first file written is assigned FileIndex equal to one and incremented for each file backed up.

  This for a given Volume, the triple VolSessionId, VolSessionTime, and FileIndex uniquely identifies a file stored on the Volume. Multiple copies of the same file may be stored on the same Volume, but for each file, the triple VolSessionId, VolSessionTime, and FileIndex will be unique. This triple is stored in the Catalog database for each file.

Slot
  The value specifies the autochanger slot. There may be only a single Slot specification for each Volume.
Stream
  The value specifies a Stream, a list of Streams, or a range of Streams to be selected from the current Volume. Unless you really know what you are doing (the internals of Bacula, you should avoid this specification.
*JobType
  Not yet implemented.
*JobLevel
  Not yet implemented.

The Volume record is a bit special in that it must be the first record. The other keyword records may appear in any order and any number following a Volume record.

Multiple Volume records may be specified in the same bootstrap file, but each one starts a new set of filter criteria for the Volume.

In processing the bootstrap file within the current Volume, each filter specified by a keyword is ANDed with the next. Thus,

    Volume = Test-01
    Client = "My machine"
    FileIndex = 1

will match records on Volume Test-01 AND Client records for My machine AND FileIndex equal to one.

Multiple occurrences of the same record are ORed together. Thus,

    Volume = Test-01
    Client = "My machine"
    Client = "Backup machine"
    FileIndex = 1

will match records on Volume Test-01 AND (Client records for My machine OR Backup machine) AND FileIndex equal to one.

For integer values, you may supply a range or a list, and for all other values except Volumes, you may specify a list. A list is equivalent to multiple records of the same keyword. For example,

    Volume = Test-01
    Client = "My machine", "Backup machine"
    FileIndex = 1-20, 35

will match records on Volume Test-01 AND (Client records for My machine OR Backup machine) AND (FileIndex 1 OR 2 OR 3 ... OR 20 OR 35).

As previously mentioned above, there may be multiple Volume records in the same bootstrap file. Each new Volume definition begins a new set of filter conditions that apply to that Volume and will be ORed with any other Volume definitions.

As an example, suppose we query for the current set of tapes to restore all files on Client Rufus using the query command in the console program:

    Using default Catalog name=MySQL DB=bacula
    *query
    Available queries:
         1: List Job totals:
         2: List where a file is saved:
         3: List where the most recent copies of a file are saved:
         4: List total files/bytes by Job:
         5: List total files/bytes by Volume:
         6: List last 10 Full Backups for a Client:
         7: List Volumes used by selected JobId:
         8: List Volumes to Restore All Files:
    Choose a query (1-8): 8

    Enter Client Name: Rufus
    +-------+------------------+------------+-----------+----------+------------+
    | JobId | StartTime        | VolumeName | StartFile | VolSesId | VolSesTime |
    +-------+------------------+------------+-----------+----------+------------+
    | 154   | 2002-05-30 12:08 | test-02    | 0         | 1        | 1022753312 |
    | 202   | 2002-06-15 10:16 | test-02    | 0         | 2        | 1024128917 |
    | 203   | 2002-06-15 11:12 | test-02    | 3         | 1        | 1024132350 |
    | 204   | 2002-06-18 08:11 | test-02    | 4         | 1        | 1024380678 |
    +-------+------------------+------------+-----------+----------+------------+

The output shows us that there are four Jobs that must be restored. The first one is a Full backup, and the following three are all Incremental backups.

The following bootstrap file will restore those files:

    Volume=test-02
    VolSessionId=1
    VolSessionTime=1022753312
    Volume=test-02
    VolSessionId=2
    VolSessionTime=1024128917
    Volume=test-02
    VolSessionId=1
    VolSessionTime=1024132350
    Volume=test-02
    VolSessionId=1
    VolSessionTime=1024380678

As a final example, assume that the initial Full save spanned two Volumes. The output from query might look like:

    +-------+------------------+------------+-----------+----------+------------+
    | JobId | StartTime        | VolumeName | StartFile | VolSesId | VolSesTime |
    +-------+------------------+------------+-----------+----------+------------+
    | 242   | 2002-06-25 16:50 | File0003   | 0         | 1        | 1025016612 |
    | 242   | 2002-06-25 16:50 | File0004   | 0         | 1        | 1025016612 |
    | 243   | 2002-06-25 16:52 | File0005   | 0         | 2        | 1025016612 |
    | 246   | 2002-06-25 19:19 | File0006   | 0         | 2        | 1025025494 |
    +-------+------------------+------------+-----------+----------+------------+

and the following bootstrap file would restore those files:

    Volume=File0003
    VolSessionId=1
    VolSessionTime=1025016612
    Volume=File0004
    VolSessionId=1
    VolSessionTime=1025016612
    Volume=File0005
    VolSessionId=2
    VolSessionTime=1025016612
    Volume=File0006
    VolSessionId=2
    VolSessionTime=1025025494

Using Bacula to Improve Your System Security | Index | Installing and Configuring MySQL

Bacula 1.32 User's Guide The Network Backup Solution | Copyright © 2000-2003 Kern Sibbald and John Walker