Bacula-users

[Bacula-users] Bacula purging wrong volume

2008-08-22 19:08:30
Subject: [Bacula-users] Bacula purging wrong volume
From: Tilman Schmidt <t.schmidt AT phoenixsoftware DOT de>
To: "bacula-users AT lists.sourceforge DOT net" <Bacula-users AT lists.sourceforge DOT net>
Date: Sat, 23 Aug 2008 01:06:33 +0200
I am running a scheme of daily, weekly and monthly backups with
- a pool "Monthly" containing twelve tapes for the months of the year,
  to be used on the first Friday of each month
- a pool "Weekly" containing four tapes "Friday-2", "Friday-3",
  "Friday-4", and "Friday-5", to be used on the remaining Fridays, and
- a pool "Daily" containing four tapes "Monday", "Tuesday", "Wednesday"
  and "Thursday", to be used on the remaining workdays of each week.

Max use times and retention periods are adjusted so that each tape
becomes eligible for recycling just in time for its next use:

Pool {
  Name = Daily
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Use Duration = 16 hours      # use only for one run
  Volume Retention = 6 days           # one week minus one day
}

Pool {
  Name = Weekly
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Use Duration = 3 days        # mark as used after weekend
  Volume Retention = 24 days          # four weeks minus one weekend
}

Pool {
  Name = Monthly
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Use Duration = 3 days        # mark as used after weekend
  Volume Retention = 360 days         # one year minus two days (leap year) 
minus one weekend
}

Of course, the Friday-5 tape is used only in months which do have
five Fridays, or about one month in three. This has never been a
problem until today, when I came home to find a mail telling me
"Intervention needed". Starting bconsole, I was presented with
these messages:

22-Aug 23:05 vm-backup-dir JobId 1505: Start Backup JobId 1505, 
Job=vm-backup.2008-08-22_23.05.33
22-Aug 23:05 vm-backup-dir JobId 1505: Max configured use duration exceeded. 
Marking Volume "Freitag-03" as Used.
22-Aug 23:05 vm-backup-dir JobId 1505: Max configured use duration exceeded. 
Marking Volume "Freitag-02" as Used.
22-Aug 23:05 vm-backup-dir JobId 1505: There are no more Jobs associated with 
Volume "Freitag-05". Marking it purged.
22-Aug 23:05 vm-backup-dir JobId 1505: All records pruned from Volume 
"Freitag-05"; marking it "Purged"
22-Aug 23:05 vm-backup-dir JobId 1505: Recycled volume "Freitag-05"
22-Aug 23:05 vm-backup-dir JobId 1505: Using Device "LTO1"
22-Aug 23:05 vm-backup-fd JobId 1505: ClientRunBeforeJob: run command "su - 
backup -c /home/backup/bin/collect-remote-backups"
22-Aug 23:07 vm-backup-fd JobId 1505: ClientRunBeforeJob: tar: 
var/lib/mysql/mysql.sock: socket ignored
22-Aug 23:08 vm-backup-fd JobId 1505: ClientRunBeforeJob: tar: 
var/spool/postfix/public/flush: socket ignored
22-Aug 23:08 vm-backup-fd JobId 1505: ClientRunBeforeJob: tar: 
var/spool/postfix/public/showq: socket ignored
22-Aug 23:08 vm-backup-fd JobId 1505: ClientRunBeforeJob: tar: 
var/spool/postfix/public/cleanup: socket ignored
22-Aug 23:09 vm-backup-sd JobId 1505: Warning: Director wanted Volume 
"Freitag-05".
    Current Volume "Freitag-04" not acceptable because:
    1998 Volume "Freitag-04" status is Used, but should be Append, Purged or 
Recycle.
22-Aug 23:09 vm-backup-sd JobId 1505: Please mount Volume "Freitag-05" or label 
a new one for:
    Job:          vm-backup.2008-08-22_23.05.33
    Storage:      "LTO1" (/dev/nst0)
    Pool:         Weekly
    Media type:   LTO1

So Bacula, even though the volume Friday-4 was mounted, decided
to purge volume Friday-5 instead, and then proceeded to complain
that Friday-4 was not the volume it wanted. This is the pool's
volume info *after* that fact:

*llist media pool=Weekly
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
          MediaId: 24
       VolumeName: Freitag-02
             Slot: 0
           PoolId: 4
        MediaType: LTO1
     FirstWritten: 2008-08-08 23:09:43
      LastWritten: 2008-08-09 03:42:45
        LabelDate: 2008-08-08 23:09:43
          VolJobs: 11
         VolFiles: 71
        VolBlocks: 995,463
        VolMounts: 6
         VolBytes: 64,219,373,568
        VolErrors: 0
        VolWrites: 5,056,634
 VolCapacityBytes: 0
        VolStatus: Used
          Enabled: 1
          Recycle: 1
     VolRetention: 2,073,600
   VolUseDuration: 259,200
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 1
          EndFile: 70
         EndBlock: 3,178
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 5
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

          MediaId: 26
       VolumeName: Freitag-04
             Slot: 0
           PoolId: 4
        MediaType: LTO1
     FirstWritten: 2008-07-25 23:09:28
      LastWritten: 2008-07-26 03:19:04
        LabelDate: 2008-07-25 23:09:28
          VolJobs: 10
         VolFiles: 65
        VolBlocks: 898,003
        VolMounts: 4
         VolBytes: 57,932,034,048
        VolErrors: 0
        VolWrites: 3,296,845
 VolCapacityBytes: 0
        VolStatus: Used
          Enabled: 1
          Recycle: 1
     VolRetention: 2,073,600
   VolUseDuration: 259,200
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 1
          EndFile: 64
         EndBlock: 2,860
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 3
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

          MediaId: 28
       VolumeName: Freitag-03
             Slot: 0
           PoolId: 4
        MediaType: LTO1
     FirstWritten: 2008-08-15 23:09:54
      LastWritten: 2008-08-16 03:09:56
        LabelDate: 2008-08-15 23:09:54
          VolJobs: 11
         VolFiles: 65
        VolBlocks: 888,064
        VolMounts: 4
         VolBytes: 57,290,849,280
        VolErrors: 0
        VolWrites: 3,343,685
 VolCapacityBytes: 0
        VolStatus: Used
          Enabled: 1
          Recycle: 1
     VolRetention: 2,073,600
   VolUseDuration: 259,200
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 0
          EndFile: 64
         EndBlock: 3,876
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 3
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

          MediaId: 31
       VolumeName: Freitag-05
             Slot: 0
           PoolId: 4
        MediaType: LTO1
     FirstWritten: 1970-01-01 01:00:00
      LastWritten: 2008-05-31 03:00:39
        LabelDate: 2008-05-30 23:09:33
          VolJobs: 0
         VolFiles: 0
        VolBlocks: 0
        VolMounts: 1
         VolBytes: 1
        VolErrors: 0
        VolWrites: 839,495
 VolCapacityBytes: 0
        VolStatus: Recycle
          Enabled: 1
          Recycle: 1
     VolRetention: 2,073,600
   VolUseDuration: 259,200
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 0
          EndFile: 60
         EndBlock: 3,824
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 1
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

You have messages.
*

Pruning the volume manually (and then mounting it once again as Bacula
had rashly unmounted it) remedied the situation and allowed the backup
to proceed, proving that there was no real reason against using it in
the first place:

*prune volume=Freitag-04
The current Volume retention period is: 24 days 
Continue? (yes/mod/no): yes
There are no more Jobs associated with Volume "Freitag-04". Marking it purged.
*m
23-Aug 00:09 vm-backup-sd JobId 1505: Please mount Volume "Freitag-05" or label 
a new one for:
    Job:          vm-backup.2008-08-22_23.05.33
    Storage:      "LTO1" (/dev/nst0)
    Pool:         Weekly
    Media type:   LTO1
*mount LTO1
3001 OK mount. Device="LTO1" (/dev/nst0)
*m
23-Aug 00:59 vm-backup-dir JobId 1505: Recycled current volume "Freitag-04"
23-Aug 00:59 vm-backup-sd JobId 1505: Recycled volume "Freitag-04" on device 
"LTO1" (/dev/nst0), all previous data lost.
23-Aug 00:59 vm-backup-sd JobId 1505: Spooling data ...
*

Can anyone explain why Bacula recycled the unavailable volume
Friday-5 instead of the mounted volume Friday-4 and, more importantly,
does anyone have an idea how I can prevent this from happening again?

Thanks in advance,
Tilman


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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>