Bacula-users

Re: [Bacula-users] Job Def for multiple job levels not working

2010-08-12 14:36:18
Subject: Re: [Bacula-users] Job Def for multiple job levels not working
From: Romer Ventura <rventura AT h-st DOT com>
To: Phil Stracchino <alaric AT metrocast DOT net>
Date: Thu, 12 Aug 2010 13:25:27 -0500
After the changes, i try to restart bacula and it complaints about "No storage" for job:
# /etc/init.d/bacula-director restart
Stopping Bacula Director...:.
Starting Bacula Director...:12-Aug 13:16 bacula-dir JobId 0: Fatal error: No storage specified in Job "H34-FileServ-dsk-tap" nor in Pool.
12-Aug 13:16 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf
 failed!

Here are what it looks like:

JobDefs {
  Name = H34-FileServ-def
  Type = Backup
  Level = Full
  Schedule = "WeeklyCycle"
  Messages = Standard
  Pool = Full-Pool-dsk-tpe
  Full Backup Pool = Full-Pool-dsk-tpe
  Differential Backup Pool = Diff-Pool-dsk-tpe
  Incremental Backup Pool = Incre-Pool-dsk-dsk
  Write Bootstrap = "/var/lib/bacula/%c.bsr"
  Priority = 10
}

Job {
  Name = H34-FileServ-dsk-tap
  JobDefs = H34-FileServ-def
  Client = housigma34-fd
  FileSet = "H34-FileServ"
}

Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full 1st sun at 20:00
  Run = Level=Differential 2nd-5th sun at 20:00
  Run = Level=Incremental mon-fri at 22:00
}

Storage {
  Name = SLDLTv4
# Do not use "localhost" here    
  Address = housigma25.domain.com                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "adsfsdfsdf"
  Device = DLTv4
  Media Type = tape
}

Storage {
  Name = File
  Address = housigma25.domain.com
  SDPort = 9103
  Password = "asdfsdfasd"
  Device = FileStorage
  Media Type = File
}

Pool {
  Name = Scratch
  Pool Type = Backup
}

Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 14 days         # one year
  Maximum Volume Jobs = 1
}

Pool {
  Name = Full-Pool-dsk-tpe
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 months
  Maximum Volume Jobs = 1
#  Label Format = Full-
  Maximum Volumes = 2
}

Pool {
  Name = Diff-Pool-dsk-tpe
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 months
  Maximum Volume Jobs = 1
#  Label Format = Full-
  Maximum Volumes = 3
}

Pool {
  Name = Incre-Pool-dsk-dsk
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 5 days
  Maximum Volume Jobs = 1
  Label Format = "IncreFileServ-"
  Maximum Volumes = 5
}

Thanks
------ 
Romer Ventura

On Aug 12, 2010, at 12:44 PM, Phil Stracchino wrote:

On 08/12/10 10:03, Romer Ventura wrote:
Hello,

I am trying to have 1Job definition and have it run Full, Incremental
and Differential backups to different media depending on the schedule
set, but i cant get it to work. What i want to do is do full backups 1st
sunday of every month and write it to tape, then do incremental backups
monday-friday and write it to disk, finally do differential backups
every sunday except for the 1st sun of the month and write it to tape.

The job "H34-FileServ-dsk-tap" keeps running every night when it should
just run on sundays

Here is what i got:

You're doing this wrong.  You've defined two separate Jobs for the same
backup, you've forced the level in your JobDefs, and you have two
redundant sets of Pool overrides.


JobDefs {
  Name = H34-FileServ-def
  Type = Backup
  Level = Incremental
  Client = housigma34-fd
  FileSet = "H34-FileServ"
  Schedule = "WeeklyCycle"
  Messages = Standard
#  Pool = Default
  Full Backup Pool = Full-Pool-dsk-tpe
  Differential Backup Pool = Diff-Pool-dsk-tpe
  Incremental Backup Pool = Incre-Pool-dsk-dsk
  Write Bootstrap = "/var/lib/bacula/%c.bsr"
  Priority = 10
}

Remove the Fileset and Client specificiation from this JobDefs resource.
 They belong in the Job resource; otherwise, you've tied this JobDefs to
a single client and completely defeated the point of JobDefs by making
it non-reusable.  I'd advise making the default level in the JobDefs
Full, and the default Pool your full pool.

Job {
  Name = H34-FileServ-dsk-tap
  JobDefs = H34-FileServ-def
  Pool = Default
  Storage = SLDLTv4
}

Don't specify the Storage in the Job definition.  Let Bacula figure out
which Storage to use.  Your FileSet and your Client directives belong
here.  You're also specifying a static default Pool in your Job which is
better left in the JobDefs.

Job {
  Name = H34-FileServ-dsk-dsk
  JobDefs = H34-FileServ-def
  Pool = Default
  Storage = File
}

Get rid of this second Job definition.  It's doing you no good
whatsoever and just confusing the issue.


Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full Pool=Full-Pool-dsk-tpe 1st sun at 20:00
  Run = Level=Differential Pool=Diff-Pool-dsk-tpe 2nd-5th sun at 20:00
  Run = Level=Incremental Pool=Incre-Pool-dsk-dsk mon-fri at 22:00
}

Remove the Pool overrides from this Schedule.  Pool overrides in the
Schedule are deprecated because they don't work reliably and cannot be
made to work reliably.  Having two sets of overrides for the same job is
likely confusing Bacula.  Keep the ones in your JobDefs; lose the ones
in the Schedule.



After those changes, you should be looking at something pretty much like
this:

JobDefs {
  Name = H34-FileServ-def
  Type = Backup
  Level = Full
  Schedule = "WeeklyCycle"
  Messages = Standard
  Pool = Full-Pool-dsk-tpe
  Full Backup Pool = Full-Pool-dsk-tpe
  Differential Backup Pool = Diff-Pool-dsk-tpe
  Incremental Backup Pool = Incre-Pool-dsk-dsk
  Write Bootstrap = "/var/lib/bacula/%c.bsr"
  Priority = 10
}

Job {
  Name = H34-FileServ-dsk-tap
  JobDefs = H34-FileServ-def
  Client = housigma34-fd
  FileSet = "H34-FileServ"
}

Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full 1st sun at 20:00
  Run = Level=Differential 2nd-5th sun at 20:00
  Run = Level=Incremental mon-fri at 22:00
}


Give that a shot and see if it works for you.

-- 
  Phil Stracchino, CDK#2     DoD#299792458     ICBM: 43.5607, -71.355
         Renaissance Man, Unix ronin, Perl hacker, Free Stater
                 It's not the years, it's the mileage.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
_______________________________________________
Bacula-users mailing list

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>