UBC Physics & Astronomy
PHAS Bacula Documentation

Bacula Documentation

bat - Bacula Administration Tool is a GUI form of bconsole, but with many additional features.
/opt/bacula/sbin/bat -c /opt/bacula/etc/bat.conf &
Start/Stop/Restart bacula Daemons
[/usr/sbin/]bacula restart
Short Command List Summary
$ bconsole
* status (will prompt you for more options...)
* status dir   (list the scheduled, running & terminated jobs)
* status client
* status client=mail-fd

* status storage
* list media  (lists all the media defined in the catalog)
* list pools  (lists pools defined in the catalog)
* list volumes   (hint: make your terminal at least 143 chars wide)

* list jobs  (lists jobs which have completed)
* list jobid=nn  (lists JobId nn from the catalog)
* list jobmedia  (list the media info for each job run)

* bls [options]   (do an ls type listing of a bacula tape or file), 
e.g.  bls -V Volume-name /dev/nst0
Change Tapes
  1. Run the query command to get info on the tapes.
    *query
    Choose a query (1-16): 15
    +---------+------------+-------------+------------+------+----------+-----------+-----------+
    | MediaId | VolumeName | GB          | Storage    | Slot | Pool     | MediaType | VolStatus |
    +---------+------------+-------------+------------+------+----------+-----------+-----------+
    |      13 | 000016L4   | 1089.1195   | QuantumSL3 |    2 | FullPool | LTO-4     | Full      |
    ...
    |      24 | 000013L4   | 0.0001      | QuantumSL3 |   16 | Daily    | LTO-4     | Append    |
    +---------+------------+-------------+------------+------+----------+-----------+-----------+
    *query
    Choose a query (1-16): 16
    +----------+--------+--------+------------+--------+
    | Volume   | Mounts | Errors | Writes     | Status |
    +----------+--------+--------+------------+--------+
    | 000019L4 |      1 |      0 | 17,319,976 | Full   |
    ...
    | 000011L4 |      7 |      0 | 11,977,273 | Append |
    +----------+--------+--------+------------+--------+
  2. Now unmount the tape in the drive and change the tapes:
    $ bconsole
    *unmount
    (now remove first tape magazine and change tapes then re-insert first tape magazine)
    (then remove second tape magazine and change tapes then re-insert second tape magazine)
    * update slots scan   (takes a while to run...)
    The defined Storage resources are:
         1: File01
         2: QuantumSL3
    Select Storage resource (1-2): 2
    Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
    3306 Issuing autochanger "slots" command.
    Device "QSL3" has 16 slots.
    Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
    3306 Issuing autochanger "list" command.
    Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
    3307 Issuing autochanger "unload slot 1, drive 0" command.
    3304 Issuing autochanger "load slot 2, drive 0" command.
    3305 Autochanger "load slot 2, drive 0", status is OK.
    block.c:999 Read error on fd=5 at file:blk 0:0 on device "LTO4" (/dev/nst0). ERR=Input/output error.
    3902 Cannot mount Volume on Storage Device "LTO4" (/dev/nst0) because:
    Requested Volume "" on "LTO4" (/dev/nst0) is not a Bacula labeled Volume, because: ERR=block.c:999 Read error on fd=5 at file:blk 0:0 on device "LTO4" (/dev/nst0). ERR=Input/output error.
    No VolName for Slot=2 InChanger set to zero.
    Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
    3307 Issuing autochanger "unload slot 2, drive 0" command.
    3304 Issuing autochanger "load slot 3, drive 0" command.
    ...
    ..
    *mount     (just mount any tape for now)
Note: If you see a read error like this:
block.c:999 Read error on fd=5 at file:blk 0:0 on device "LTO4" (/dev/nst0). ERR=Input/output error.
...it means the volume is not labeled.
Note: If you see a message like this:
Volume "KUC923L4" not found in catalog. Slot=10 InChanger set to zero. 
then you have inserted tapes that bacula does not yet know of, and they need to be labeled. Restoring Very Old Files

The bscan program can be used to re-create a database (catalog) records from the backup information written to one or more Volumes. This is normally needed only if one or more Volumes have been pruned or purged from your catalog so that the records on the Volume are no longer in the catalog, or for Volumes that you have archived.

NOTE: Make sure your file retention period is set big enough so that your restored catalogue file info is not pruned as soon as you start bacula.
root@zeta:/etc/bacula]$ mtx -f /dev/sg8 status
  Storage Changer /dev/sg8:1 Drives, 16 Slots ( 0 Import/Export )
Data Transfer Element 0:Full (Storage Element 5 Loaded):VolumeTag = EOK842L4                        
      Storage Element 1:Full 
      Storage Element 2:Full 
      Storage Element 3:Full 
      Storage Element 4:Full 
      Storage Element 5:Empty
      Storage Element 6:Full 
      Storage Element 7:Full 
      Storage Element 8:Full 
      Storage Element 9:Full 
      Storage Element 10:Full 
      Storage Element 11:Full 
      Storage Element 12:Full 
      Storage Element 13:Full 
      Storage Element 14:Full 
      Storage Element 15:Full 
      Storage Element 16:Full 
root@zeta:/etc/bacula]$ mtx -f /dev/sg8 load 10 0
Drive 0 Full (Storage Element 5 loaded)
root@zeta:/etc/bacula]$ mtx -f /dev/sg8 unload 5 0
Unloading Data Transfer Element into Storage Element 5...done
root@zeta:/etc/bacula]$ mtx -f /dev/sg8 load 10 0
root@zeta:/etc/bacula]$ bscan -s -m -P "pHy2./bAcUlA" -c /etc/bacula/bacula-sd.conf -v -V 000018L4\|000019L4 /dev/nst1
bscan: butil.c:281 Using device: "/dev/nst1" for reading.
10-Jun 11:14 bscan JobId 0: Invalid slot=0 defined in catalog for Volume "000018L4" on "LTO4" (/dev/nst1). Manual load may be required.
10-Jun 11:14 bscan JobId 0: 3301 Issuing autochanger "loaded? drive 0" command.
10-Jun 11:14 bscan JobId 0: 3302 Autochanger "loaded? drive 0", result is Slot 10.
10-Jun 11:14 bscan JobId 0: Ready to read from volume "000018L4" on device "LTO4" (/dev/nst1).
bscan: bscan.c:308 Using Database: bacula, User: bacula
bscan: bscan.c:450 Pool record for FullPool found in DB.
bscan: bscan.c:464 Pool type "Backup" is OK.
bscan: bscan.c:474 Media record for 000018L4 found in DB.
bscan: bscan.c:492 Media type "LTO-4" is OK.
bscan: bscan.c:502 VOL_LABEL: OK for Volume: 000018L4
....
Manually Recycling Volumes
Assuming that you want to keep the Volume name, but you simply want to write new data on the tape, the steps to take are:
purge volume=KUC926L4
Once the Volume is marked Purged, it will be recycled the next time a Volume is needed.

If you wish to reuse the tape by giving it a new name or using it in a different pool, follow the following steps:

purge volume=KUC926L4
update volume=KUC926L4 pool=FullPool

For Bacula versions prior to 1.30 or to manually relabel the Volume, use the instructions below:

Please be aware that the delete command can be dangerous. Once it is done, to recover the File records, you must either restore your database as it was before the delete command, or use the bscan utility program to scan the tape and recreate the database entries. When the Tape Fills

If you have scheduled your job, typically nightly, there will come a time when the tape fills up and Bacula cannot continue. In this case, Bacula will send you a message similar to the following:

backup-sd: block.c:337 === Write error errno=28: ERR=No space left on device

This indicates that Bacula got a write error because the tape is full. Bacula will then search the Pool specified for your Job looking for an appendable volume. In the best of all cases, you will have properly set your Retention Periods and you will have all your tapes marked to be Recycled, and Bacula will automatically recycle the tapes in your pool requesting and overwriting old Volumes. If you find that your Volumes were not properly recycled (usually because of a configuration error), please see the Manually Recycling Volumes section of the Recycling chapter in the bacula manual.

If you have a very large set of Volumes and you label them with the date the Volume was first writing, or you have not set up your Retention periods, Bacula will not find a tape in the pool, and it will send you a message similar to the following:

04-Aug 08:41 backup-sd JobId 2658: Please mount Volume "000015" or label a new one for:
    Job:          alpha.2009-08-01_19.05.00_25
    Storage:      "LTO4" (/dev/nst0)
    Pool:         FullPool
    Media type:   LTO-4

Until you create a new Volume, this message will be repeated an hour later, then two hours later, and so on doubling the interval each time up to a maximum interval of one day.

What do I do now?

First, using the Console program, close the tape drive using the unmount command. If you only have a single drive, it will be automatically selected, otherwise, make sure you release the one specified on the message (in this case STD-10000).

Next, you remove the tape from the drive and insert a new blank tape. Note, on some older tape drives, you may need to write an end of file mark (mt -f /dev/nst0 weof) to prevent the drive from running away when Bacula attempts to read the label.

Finally, you use the label command in the Console to write a label to the new Volume. The label command will contact the Storage daemon to write the software label, if it is successful, it will add the new Volume to the Pool, then issue a mount command to the Storage daemon. See the previous sections of this chapter for more details on labeling tapes.

The result is that Bacula will continue the previous Job writing the backup to the new Volume.

If you have a Pool of volumes and Bacula is cycling through them, instead of the above message "Cannot find any appendable volumes.", Bacula may ask you to mount a specific volume. In that case, you should attempt to do just that. If you do not have the volume any more (for any of a number of reasons), you can simply mount another volume from the same Pool, providing it is appendable, and Bacula will use it. You can use the list volumes command in the console program to determine which volumes are appendable and which are not.

If you have your Volume retention periods set correctly, but you have no more free Volumes, you can relabel and reuse a Volume as follows:

To manually relabel the Volume use the following additional steps:

Labeling Tapes
When you put in new tapes with barcodes, the easiest way to label them is as follows:
*label storage=QuantumSL3 pool=FullPool slots=2-5 barcodes
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
3306 Issuing autochanger "slots" command.
Device "QSL3" has 16 slots.
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
3306 Issuing autochanger "list" command.
The following Volumes will be labeled:
Slot  Volume
==============
   2  000004L4
   3  000005L4
   4  000020L4
   5  000006L4
Do you want to label these Volumes? (yes|no): yes
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
Sending label command for Volume "000004L4" Slot 2 ...
3307 Issuing autochanger "unload slot 1, drive 0" command.
3304 Issuing autochanger "load slot 2, drive 0" command.
3305 Autochanger "load slot 2, drive 0", status is OK.
block.c:999 Read error on fd=5 at file:blk 0:0 on device "LTO4" (/dev/nst0). ERR=Input/output error.
3000 OK label. VolBytes=64512 DVD=0 Volume="000004L4" Device="LTO4" (/dev/nst0)
Catalog record for Volume "000004L4", Slot 2  successfully created.
Sending label command for Volume "000005L4" Slot 3 ...
...
..
*label storage=QuantumSL3 pool=Daily slots=6-8,10 barcodes
Enter new Volume name: .
*label storage=QuantumSL3 pool=Daily slots=6-8,10 barcodes
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
3306 Issuing autochanger "slots" command.
Device "QSL3" has 16 slots.
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
3306 Issuing autochanger "list" command.
The following Volumes will be labeled:
Slot  Volume
==============
   6  000007L4
   7  000008L4
   8  000009L4
  10  000010L4
Do you want to label these Volumes? (yes|no): yes
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
Sending label command for Volume "000007L4" Slot 6 ...
3307 Issuing autochanger "unload slot 5, drive 0" command.
3304 Issuing autochanger "load slot 6, drive 0" command.
3305 Autochanger "load slot 6, drive 0", status is OK.
block.c:999 Read error on fd=5 at file:blk 0:0 on device "LTO4" (/dev/nst0). ERR=Input/output error.
3000 OK label. VolBytes=64512 DVD=0 Volume="000007L4" Device="LTO4" (/dev/nst0)
Catalog record for Volume "000007L4", Slot 6  successfully created.
Sending label command for Volume "000008L4" Slot 7 ...
...
..
Problem: Media record for Slot 3 Volume "EOK824L4" already exists.
Solution:
*delete volume=EOK824L4

Problem: 3920 Cannot label Volume because it is already labeled: "TestVolume2" Label command failed for Volume 000001L4.

Mount the volume:

mount slot=9
Stop bacula console and bacula services:
*quit
[root@backup]# /etc/bacula/scripts/bacula stop
Stopping the Bacula File daemon
Stopping the Bacula Storage daemon
Stopping the Bacula Director daemon
Rewind and write an eof mark:
[root@backup]# mt -f /dev/st0 rewind
[root@backup]# mt -f /dev/st0 weof
Restart the bacula services:
[root@backup]# /etc/bacula/scripts/bacula start
Starting the Bacula Storage daemon
Starting the Bacula File daemon
Starting the Bacula Director daemon
Start bconsole:
[root@backup]# bconsole
Connecting to Director backup:9101
1000 OK: backup-dir Version: 2.4.2 (26 July 2008)
Enter a period to cancel a command.
Label the tape:
*label storage=QuantumSL3 pool=Daily slots=9 barcodes
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
3306 Issuing autochanger "slots" command.
Device "QSL3" has 16 slots.
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
3306 Issuing autochanger "list" command.
The following Volumes will be labeled:
Slot  Volume
==============
   9  KUC920L4
Do you want to label these Volumes? (yes|no): yes
Connecting to Storage daemon QuantumSL3 at backup.phas.ubc.ca:9103 ...
Sending label command for Volume "KUC920L4" Slot 9 ...
3000 OK label. VolBytes=64512 DVD=0 Volume="KUC920L4" Device="LTO4" (/dev/nst0)
Catalog record for Volume "KUC920L4", Slot 9  successfully created.

Which machines were backed up on which tape

$ bconsole
*sqlquery
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Entering SQL query mode.
Terminate each query with a semicolon.
Terminate query mode with a blank line.
Enter SQL query:

Just list

Enter SQL query: select JobID, MediaID from JobMedia GROUP BY JobID, MediaID;

List with job name (indicative of host name)

Enter SQL query: select Job.Name, Job.JobID, JobMedia.MediaID from Job, JobMedia WHERE Job.JobID = JobMedia.JobID GROUP BY JobMedia.JobID, MediaID;

List with job name and tape name

Enter SQL query: select Job.Name, Job.JobID, JobMedia.MediaID, Media.VolumeName from Job, JobMedia, Media WHERE Job.JobID = JobMedia.JobID AND JobMedia.MediaID = Media.MediaID GROUP BY JobMedia.JobID, MediaID;

Example output of the last query:

+---------------+-------+---------+------------+
| Name          | JobID | MediaID | VolumeName |
+---------------+-------+---------+------------+
| mail          |   122 |       5 | KUC921L4   |
| backup        |   123 |       5 | KUC921L4   |
| alpha         |   124 |       5 | KUC921L4   |
| www           |   125 |       5 | KUC921L4   |
| BackupCatalog |   126 |       9 | 000003L4   |
| mail          |   128 |       5 | KUC921L4   |
| backup        |   129 |       5 | KUC921L4   |
| alpha         |   130 |       5 | KUC921L4   |
| www           |   131 |       5 | KUC921L4   |
| BackupCatalog |   132 |       9 | 000003L4   |
+---------------+-------+---------+------------+

A “WHERE” clause can be added before the semicolon to specify that only a specific tape or job be listed, eg:

WHERE JobMedia.JobID=35;

if you are more interested in which tapes were used by a job and

WHERE JobMedia.MediaID=2

if you are more interested in which jobs are stored on a given tape.

To leave sqlquery mode, just press enter when you have an empty input.

Difference between Volume name and Media ID

The media ID is an integer key assigned incrementally to new media as they are created within bacula. The first ID is ‘1’. Its primary use is as a database key but may also be used in requests to refer to a specific volume in the current catalog. It is especially useful if the volumes don’t have names, but that is not our case.

The volume Name is a string associated with a volume. We use the barcode label as the volume name. As a result of this, referring to a tape by its name will refer to the same tape no matter what catalog is loaded.

Expire tapes

Option 1: purge the tape. This cleans out jobs and files that were on the tape and ignores retention timing (forced expiration)

$ bconsole
*purge

This command is can be DANGEROUS!!!

It purges (deletes) all Files from a Job,
JobId, Client or Volume; or it purges (deletes)
all Jobs from a Client or Volume without regard
for retention periods. Normally you should use the
PRUNE command, which respects retention periods.
You have the following choices:
     1: files
     2: jobs
     3: volume
Choose item to purge (1-3): 3
[...]
Enter MediaId or Volume name: S00001

Option 2: mark the tape as used so it will be recycled without cleaning up jobs and files. This is probably dangerous and might not work.

$ bconsole
*update
Using default Catalog name=MyCatalog DB=bacula
Update choice:
     1: Volume parameters
     2: Pool from resource
     3: Slots from autochanger
Choose catalog item to update (1-3): 1
Parameters to modify:
     1: Volume Status
     2: Volume Retention Period
     3: Volume Use Duration
     4: Maximum Volume Jobs
     5: Maximum Volume Files
[...]
    13: All Volumes from Pool
    14: Done
Select parameter to modify (1-14): 1
[...]
Enter MediaId or Volume name: S00001
Updating Volume "S00001"
Current Volume status is: Full
Possible Values are:
     1: Append
     2: Archive
     3: Disabled
     4: Full
     5: Used
     6: Cleaning
     7: Read-Only
Choose new Volume Status (1-7): 5
Showing defined jobs

Easiest thing is to execute the “run” command, view the list, then exit with .

*run
A job name must be specified.
The defined Job resources are:
     1: mail
     2: alpha
     3: www
     4: backup
     5: BackupCatalog
     6: RestoreFiles
     7: Watchdog
Select Job resource (1-7): .
Selection aborted, nothing done.
*
General syntax . enter

One common state you will encounter in the bconsole app is being where you don’t want to be (somewhere within a menu tree). At (just about) any point where input is asked, you can give a single period character followed by enter. This will return you to the main prompt.

Force run a backup

execute bconsole:

*run

follow the prompts, entering the numbers you want:

Using default Catalog name=MyCatalog DB=bacula
A job name must be specified.
The defined Job resources are:
     1: mail
     2: alpha
     3: www
     4: backup
     5: BackupCatalog
     6: RestoreFiles
     7: Watchdog
Select Job resource (1-7):

enter 2 to backup alpha:

Select Job resource (1-4): 2
Run Backup job
JobName:  alpha
Level:    Incremental
Client:   alpha-fd
FileSet:  alphaFull
Pool:     Daily (From Job resource)
Storage:  QuantumSL3 (From Job resource)
When:     2008-09-16 15:53:54
Priority: 11
OK to run? (yes/mod/no):

type “yes” to run it::

OK to run? (yes/mod/no): yes
Job started. JobId=19
*

If you choose mod, it will prompt you in a similar manner to modify the settings. This allows you to, for example, set the level to be full instead of incremental, or to change when to schedule running the manual backup, etc.

Add a client

On the server side

First, modify the bacula director configuration file:

vi /opt/bacula/etc/bacula-dir.conf

And follow the template for existing clients. Be sure to copy both the client and job definition for the client. After making your changes, run bconsole:

$ bconsole
*

and execute a reload:

*reload
*

on success you should see nothing. On a failure, you will hopefully get a message, and the director will probably crash. Fix the problems in the config file and restart the director to get things back up-and-running:

/etc/bacula/scripts/bacula restart

And all should be well.

On the client side

Install bacula-fd on the client and make sure that the secret key matches on both the client and the server. Note that the key should be changed from the default if the install was from a binary package.

Restore data

Start bconsole as normal, and execute the ‘restore’ command:

*restore
Using default Catalog name=MyCatalog DB=bacula

First you select one or more JobIds that contain files
to be restored. You will be presented several methods
of specifying the JobIds. Then you will be allowed to
select which files from those JobIds are to be restored.

To select the JobIds, you have the following choices:
     1: List last 20 Jobs run
     2: List Jobs where a given File is saved
     3: Enter list of comma separated JobIds to select
     4: Enter SQL list command
     5: Select the most recent backup for a client
     6: Select backup for a client before a specified time
     7: Enter a list of files to restore
     8: Enter a list of files to restore before a specified time
     9: Find the JobIds of the most recent backup for a client
    10: Find the JobIds for a backup for a client before a specified time
    11: Enter a list of directories to restore for found JobIds
    12: Cancel
Select item:  (1-12):

Usually do 5 or 6. Let us assume the desired tree was deleted very recently:

Select item:  (1-12): 5
Defined Clients:
     1: backup-fd
     2: alpha-fd
     3: mail-fd
     4: www-fd
     5: Watchdog
Select the Client (1-5): 2
The defined FileSet resources are:
     1: AlphaFull
     2: Full Set
     3: alphaFull
Select FileSet resource (1-3): 3
+-------+-------+-----------+-------------------+---------------------+------------+
| JobId | Level | JobFiles  | JobBytes          | StartTime           | VolumeName |
+-------+-------+-----------+-------------------+---------------------+------------+
|    74 | F     | 3,078,157 | 1,122,789,385,470 | 2008-09-07 10:06:18 | 000001L4   |
|    74 | F     | 3,078,157 | 1,122,789,385,470 | 2008-09-07 10:06:18 | 000002L4   |
|   118 | D     |   146,565 |    43,592,033,045 | 2008-09-13 21:51:35 | KUC921L4   |
|   124 | I     |     3,149 |     1,250,807,890 | 2008-09-14 20:38:54 | KUC921L4   |
|   130 | I     |    24,721 |    43,581,164,038 | 2008-09-15 21:29:09 | KUC921L4   |
+-------+-------+-----------+-------------------+---------------------+------------+
You have selected the following JobIds: 74,118,124,130

Building directory tree for JobId 74 ...  ++++++++++++++++++++++++++++++++++++++++++++++++
Building directory tree for JobId 118 ...  +
Building directory tree for JobId 124 ...  
Building directory tree for JobId 130 ...  
4 Jobs, 3,065,115 files inserted into the tree.

You are now entering file selection mode where you add (mark) and
remove (unmark) files to be restored. No files are initially added, unless
you used the "all" keyword on the command line.
Enter "done" to leave this mode.

cwd is: /
$

As you can see, it is showing (in the VolumeName column) the tapes used to generate this tree, and it shows that it is combining a full and an incremental for the file list. Let’s say we want to restore /etc::

$ cd /home/rap/xfig
cwd is: /home/rap/xfig/
$ ls
F200_ep8.ps
PhysAsto-Racks.fig
PhysAsto-Racks.fig.bak
mark PhysAsto-Racks.fig.bak
1 file marked.
$ done
Bootstrap records written to /opt/bacula/var/backup-dir.restore.1.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================
   000001L4                  QuantumSL3                QSL3                     

1 file selected to be restored.

Run Restore job
JobName:         RestoreFiles
Bootstrap:       /opt/bacula/var/backup-dir.restore.1.bsr
Where:           /tmp/bacula-restores
Replace:         always
FileSet:         FullSet
Backup Client:   alpha-fd
Restore Client:  alpha-fd
Storage:         QuantumSL3
When:            2008-09-16 16:09:49
Catalog:         MyCatalog
Priority:        10
OK to run? (yes/mod/no):
Marking files with special characters - enclose in quotes as per this example:
$ mark ".ENPH F09"

At this point, it shows exactly what tapes will be needed to restore this (note that there might be fewer tapes needed for the restore than were in the list to make up the restore tree). Typing yes now would restore into /tmp/bacula-restores, creating the directory /tmp/bacula-restores/home/rap/xfig

To change where the restore occurs, to which client, replacement policy, etc. type ‘mod’ instead and follow the prompts. Type ‘.’ and press return at any time to cancel the menu system and the restore job.

Adjust Schedules

  1. Edit /opt/bacula/etc/bacula-dir.conf.
  2. Search for the Schedule sections
  3. Change it
  4. Restart the director or execute a reload command in the console: /etc/bacula/scripts/bacula restart

There can be several settings of the Run parameter; one for each of Full, Differential and Incremental, for ex:

Schedule {
 Name = "WeeklyCycle"
 Run = Full 1st sun at 23:05
 Run = Differential 2nd-5th sun at 23:05
 Run = Incremental mon-sat at 23:05
}

This will run a full backup the first sunday of every month 55 minutes before midnight (23:05 = 11:05pm), a Differential (what changed since last full) every sunday that is not the first (2nd-5th = 2nd, 3rd, 4th, 5th), and Incrementals (what changed since last backup) every day of the week except sunday.

Check Previous Runs

There are two ways to check previous runs: one is to verify that a backup was correct (by doing a mock-restore) and the other is to just check that things went OK (by looking at the list of history and status).

Verify

This would require a job with type “verify” to be defined. Running a verify will take the same amount of time that running the original backup did (since it is actually re-running the backup and just comparing the data)

List

To simply get a list of job runs:

*list jobs
+-------+---------------+---------------------+------+-------+-----------+-------------------+-----------+
| JobId | Name          | StartTime           | Type | Level | JobFiles  | JobBytes          | JobStatus |
+-------+---------------+---------------------+------+-------+-----------+-------------------+-----------+
|    60 | www           | 2008-09-05 10:46:56 | B    | F     |   111,047 |    48,635,822,098 | T         |
|    61 | BackupCatalog | 2008-09-05 14:14:18 | B    | F     |         1 |        15,015,068 | T         |
|    63 | mail          | 2008-09-05 15:29:39 | B    | F     |        53 |        33,237,328 | T         |
|    64 | alpha         | 2008-09-05 15:33:58 | B    | F     |        53 |        33,883,423 | T         |
|    65 | www           | 2008-09-05 15:35:38 | B    | F     |       108 |        55,590,981 | T         |
|    66 | mail          | 2008-09-05 19:05:00 | B    | F     |    81,788 |     5,523,192,608 | T         |
|    67 | backup        | 2008-09-05 19:26:31 | B    | I     |       481 |       113,823,833 | T         |
|    68 | alpha         | 2008-09-05 19:29:51 | B    | F     | 3,073,792 | 1,121,951,892,897 | T         |
|    71 | Watchdog      | 2008-09-07 09:45:49 | D    | F     |         0 |                 0 | T         |
|    72 | mail          | 2008-09-07 09:45:50 | B    | F     |    81,892 |     5,523,836,716 | T         |
|   127 | Watchdog      | 2008-09-15 06:05:02 | D    | F     |         0 |                 0 | T         |
|   128 | mail          | 2008-09-15 19:06:25 | B    | I     |     6,293 |    65,273,583,102 | T         |
|   129 | backup        | 2008-09-15 21:29:03 | B    | I     |         0 |                 0 | T         |
|   130 | alpha         | 2008-09-15 21:29:09 | B    | I     |    24,721 |    43,581,164,038 | T         |
|   131 | www           | 2008-09-15 23:39:31 | B    | I     |       549 |       170,803,110 | T         |
|   132 | BackupCatalog | 2008-09-16 04:06:27 | B    | F     |         1 |       941,977,053 | T         |
|   133 | Watchdog      | 2008-09-16 06:05:02 | D    | F     |         0 |                 0 | T         |
|   134 | RestoreFiles  | 2008-09-16 14:22:11 | R    | F     |         1 |               330 | T         |
+-------+---------------+---------------------+------+-------+-----------+-------------------+-----------+
*

High levels of detail can be gotten with llist instead of list (two ‘l’ characters):

*llist jobid=124
           JobId: 124
             Job: alpha.2008-09-14_19.05.16
            Name: alpha
     PurgedFiles: 0
            Type: B
           Level: I
        ClientId: 2
            Name: alpha-fd
       JobStatus: T
       SchedTime: 2008-09-14 19:05:00
       StartTime: 2008-09-14 20:38:54
         EndTime: 2008-09-14 21:16:38
     RealEndTime: 2008-09-14 21:16:38
        JobTDate: 1,221,452,198
    VolSessionId: 13
  VolSessionTime: 1,221,261,733
        JobFiles: 3,149
       JobErrors: 0
 JobMissingFiles: 0
          PoolId: 3
        PooLname: Daily
      PriorJobId: 0
       FileSetId: 15
         FileSet: alphaFull
Misc Commands:
mtx -f /dev/sg1 [ status | inquiry | inventory ] 

tapeinfo -f /dev/sg[0|1|4]   (LTO4|QSL3|LTO3)

scsitape -f /dev/sg0 rewind

mtx -f /dev/sg1 [un]load 1 0   (slot drive)

Misc Problems / Solutions:

Invalid slot=0 defined in catalog for Volume
10-Aug 08:50 backup-sd JobId 2711: Invalid slot=0 defined in catalog for Volume "EOK817L4" on "LTO4" (/dev/nst0). Manual load may be required.
*
*mess
10-Aug 08:51 backup-sd JobId 2711: Warning: acquire.c:260 Read acquire: Wrong Volume mounted on device "LTO4" (/dev/nst0): Wanted EOK817L4 have KUC924L4
10-Aug 08:51 backup-sd JobId 2711: Invalid slot=0 defined in catalog for Volume "EOK817L4" on "LTO4" (/dev/nst0). Manual load may be required.
10-Aug 08:51 backup-sd JobId 2711: Please mount Volume "EOK817L4" for:
    Job:          RestoreFiles.2009-08-07_16.09.53_13
    Storage:      "LTO4" (/dev/nst0)
    Pool:         Daily
    Media type:   LTO-4
Opened new shell window and typed:
[root@backup ~]# mtx -f /dev/sg1 load 10 0
Loading media from Storage Element 10 into drive 0...done

Solidworks PDM Vault Backup (Vaultdata)

Always copy the complete vault, never make partial backups. When restoring a vault, always restore the complete vault. The vault contains SolidWorks Workgroup PDM configuration data in addition to project documents.

  • Back up the vault regularly.
  • Store the backup copy on a server different from the one where the vault resides.
  • Test the backup to be sure your procedure works correctly.
  • Stop the vault service, or lock the vault on the VaultAdmin Vault Settings tab, so clients cannot check in documents, change ownership, etc.
  • Clear the options on the VaultAdmin Vault Settings tab for validating the vault on startup, especially if the vault is large.

You can replace the current vault copy with a backup copy of the vault, if you want to revert to a previous version of the vault.

To make a backup copy of the vault:
  1. Stop the Workgroup PDM vault service.
  2. Stop the Windows Indexing service.
  3. Save a copy of the current vault, and name it VaultData_mm_dd_yy.
  4. Start the Windows Indexing service.
  5. Start the Workgroup PDM vault service.
To replace the current vault copy with a backup copy:
  1. Stop the Workgroup PDM vault service.
  2. Rename the current vault to VaultData_old.
  3. Copy the backup vault to the location of the current vault, and rename it VaultData.
  4. Start the Workgroup PDM vault service.