OK, so I'm trying to do this myself.

1. Before we get into the nitty gritty, I have noticed that parameters are listed with a space between words, but often in config files without. Eg. "Always Open =" is sometimes seen as "AlwaysOpen = " - is this ok?

2. Please could someone explain to me what the backup catalog is needed for and if the bacula-dir.conf file I attached file looks right.

3. You will notice, as per a similar example in the manual I have added RunAfterJob = "/etc/bacula/end_of_backup.sh", with the contents of end_of_backup.sh being:
#! /bin/sh
/var/lib/bacula/delete_catalog_backup
mt rewind
mt eject
exit 0

Now the only problem I can see here is that this runs immediately after the job, but immediately after that, the DailyCatalog will run, and that also executes "/var/lib/bacula/delete_catalog_backup" - again, what is the catalog and what's gonna happen if it gets deleted twice? Should I remove it from the end_of_backup.sh script, or should I rather move the end_of_backup script to to be run in the DailyCatalog job?

4. I added Always Open = no and Automatic Mount = yes to the device resource in bacula-sd.conf:
Device {
 Name = DAT-72
 Media Type = DAT-72
 Archive Device = /dev/nst0
 Automatic Mount = yes;
 Always Open = no;
 Removable Media = yes;
 Random Access = no;
}

Now I need to test.  Will advise tomorrow.

Regards
Warwick


Arno Lehmann wrote:
Hello,

On 3/23/2006 4:21 PM, Kern Sibbald wrote:
On Thursday 23 March 2006 16:06, Warwick Bruce Chapman wrote:

Hi All

First off, I must apologise for using this awesome tool for something as
simple as a single tape daily backup.

I have configured a job called DailyBackup which runs Mon-Fri 23:00, and
a BackupCatalog which runs 55 mins later.  Tapes are changed daily, one
tape per day.  I seem to have problems with backup waiting for the the
tapes even though they're in the drive.  I must admit to not being 100%
sure about all this, so would like to know if anyone has written a
guide/howto something like "How to cripple Bacula into doing a silly
little DailyBackup" ;)

Hmm.

Shouldn't it be enough to make sure that tape mounting is done automatically (I never used these options, so I tend to forget how you set up "Always Open", "Volume Poll Interval", "Close on Poll" and "Offline on Unmount" options correctly, and perhaps use an administrative job that calls a script to actually eject the cartridge after the job is done?

Or, if accepting the newly mounted tape is the problem, use a cron job to issue a mount command prior to job start.

You could even start Bacula only when needed, i.e. shortly before the jobs should run - at startup, the SD always checks the tape drive and, if possible at all, mounts the tape in it. (This is something I do, by the way, only I start the whole server, not only Bacula, and shut it down automatically when all jobs are run.)

Yes, I second that, and I would love to see such a document and include it in the manual, but I am not the one to write it since my setup isn't at all a silly little DailyBackup, though it doesn't even come close to matching Arno's backup :-)

Too much honour :-)

I admit that I found some interesting bugs and problems, some of them only because I use two autochangers, but apart from that I think my setup is quite straightforward. As much so as the available hardware limits it, of course ;-)

Arno


--
Warwick Chapman
Marketing and Operations
Thusa Business Support cc

Cellular: +27 83 7797 094
Telephone: +27 31 571 1500
Facsimile: +27 31 571 1519
Website: http://www.thusa.co.za

-- There are 10 types of people in this world. Those who understand binary, and those who don't.
#
# Default Bacula Director Configuration file
#
#  The only thing that MUST be changed is to add one or more
#   file or directory names in the Include directive of the
#   FileSet resource.
#
#  For Bacula release 1.36.3 (22 April 2005) -- gentoo 1.6.13
#
#  You might also want to change the default email address
#   from root to your address.  See the "mail" and "operator"
#   directives in the Messages resource.
#

Director {                            # define myself
  Name = gateway-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/var/lib/bacula/query.sql"
  WorkingDirectory = "/var/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = ""         # Console password
  Messages = Daemon
}

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Full
  Client = gateway-fd 
  FileSet = "Daily Set"
  Schedule = "DailyBackup"
  Storage = DAT-72
  Messages = Standard
  Pool = Default
  Priority = 10
}

#
# Define the main nightly save backup job
#   By default, this job will back up to disk in /tmp
Job {
  Name = "DailyBackup"
  JobDefs = "DefaultJob"
  Write Bootstrap = "/var/bacula/DailyBackup.bsr"
  RunAfterJob = "/etc/bacula/end_of_backup.sh"
}

# Backup the catalog database (after the nightly save)
Job {
  Name = "BackupCatalog"
  JobDefs = "DefaultJob"
  Level = Full
  FileSet="Catalog"
  Schedule = "DailyCatalog"
  # This creates an ASCII copy of the catalog
  RunBeforeJob = "/var/lib/bacula/make_catalog_backup bacula bacula admin123"
  # This deletes the copy of the catalog
  RunAfterJob  = "/var/lib/bacula/delete_catalog_backup"
  Write Bootstrap = "/var/bacula/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
}

# Standard Restore template, to be changed by Console program
Job {
  Name = "RestoreFiles"
  Type = Restore
  Client=gateway-fd                 
  FileSet="Daily Set"                  
  Storage = DAT-72                      
  Pool = Default
  Messages = Standard
  Where = /tmp/bacula-restores
}


FileSet {
  Name = "Daily Set"
  Include {
    Options {
      signature = MD5
    }
    File = /etc
    File = /usr/local/data
    File = /var/lib/openldap-data
    File = /var/bind
    File = /var/spool/mail
  }

}

# Daily backup
Schedule {
  Name = "DailyBackup"
  Run = Full mon-fri at 23:00
}

# Daily catalog
Schedule {
  Name = "DailyCatalog"
  Run = Full mon-fri at 23:55
}

# This is the backup of the catalog
FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /var/bacula/bacula.sql
  }
}

# Client (File Services) to backup
Client {
  Name = gateway-fd
  Address = localhost
  FDPort = 9102
  Catalog = MyCatalog
  Password = ""
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}


# Definition of DDS tape storage device
Storage {
  Name = DAT-72    
  Address = localhost
  SDPort = 9103
  Password = ""
  Device = DAT-72
  Media Type = DAT-72
}


# Generic catalog service
Catalog {
  Name = MyCatalog
  dbname = bacula; user = bacula; password = ""
}

# Reasonable message delivery -- send most everything to email address
#  and to the console
Messages {
  Name = Standard
#
# NOTE! If you send to two email or more email addresses, you will need
#  to replace the %r in the from field (-f part) with a single valid
#  email address in both the mailcommand and the operatorcommand.
#
  mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: 
%t %e of %c %l\" %r"
  operatorcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s 
\"Bacula: Intervention needed for %j\" %r"
  mail = [EMAIL PROTECTED] = all, !skipped            
  operator = [EMAIL PROTECTED] = mount
  console = all, !skipped, !saved
#
# WARNING! the following will create a file that you must cycle from
#          time to time as it will grow indefinitely. However, it will
#          also keep all your messages if they scroll off the console.
#
  append = "/var/bacula/log" = all, !skipped
}


#
# Message delivery for daemon messages (no job).
Messages {
  Name = Daemon
  mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula 
daemon message\" %r"
  mail = [EMAIL PROTECTED] = all, !skipped            
  console = all, !skipped, !saved
  append = "/var/bacula/log" = all, !skipped
}


# Default pool definition
Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 days
  Accept Any Volume = yes
}

#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
  Name = gateway-mon
  Password = ""
  CommandACL = status, .status
}
begin:vcard
fn:Warwick Bruce Chapman
n:Chapman;Warwick Bruce
org:Thusa Business Support cc;Operations and Management
adr:Umgeni Park;;65 Hunters Way;Durban North;KZN;4051;RSA
email;internet:[EMAIL PROTECTED]
title:Member
tel;work:+27 31 571 1500
tel;fax:+27 31 571 1519
tel;cell:+27 83 7797 094
x-mozilla-html:FALSE
url:http://www.thusa.co.za
version:2.1
end:vcard

Reply via email to