bacula awk script for sqlite catalog backup broken

Bug #614320 reported by David Stenglein
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bacula
Invalid
Undecided
Unassigned
bacula (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: bacula-director-sqlite3

When I try to run a catalog backup it appears to be endlessly looping and recreating the sqlite dump. It is not quite endless though, just a bug in the awk script.

The script /etc/bacula/scripts/make_catalog_backup_awk contains:

system("echo '.dump' | /usr/bin/sqlite3 /var/lib/bacula/bacula.db > /var/lib/bacula/bacula.sql")

This gets run as part of:

/usr/bin/awk -f /etc/bacula/scripts/make_catalog_backup_awk -v cat1=MyCatalog /etc/bacula/bacula-dir.conf

which essentially does the sqlite dump for every line in bacula-dir.conf.

The simplest way to solve this and maintain compatibility with other versions of this script for other databases is to use:

BEGIN {system("echo '.dump' | /usr/bin/sqlite3 /var/lib/bacula/bacula.db > /var/lib/bacula/bacula.sql")}

This may have gone unnoticed since the sqlite3 back-end is not the default for bacula installs.

Related branches

Changed in bacula (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Confirmed that the script is doing "the wrong thing", and the proposed fix is the right way to go.

Marking Importance Low because, while it does waste a lot of time and system resources, it still "works", just not very well.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Oh, and I almost forgot, David, thank you for reporting this bug and working with us to make Ubuntu better!

Revision history for this message
David Stenglein (stengleind) wrote :

You're welcome. Amusingly enough, right after posting this bug I've switched to using mysql. I'm running bacula on a single machine and using sqlite causes huge problems with the way it handles synchronous writes when there are a large number of files to be scanned for backup.

Glad I could catch that bug first, though.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bacula - 5.2.5-0ubuntu3

---------------
bacula (5.2.5-0ubuntu3) precise; urgency=low

  * fix db-common configuration of database name (LP: #830108)

  [ David Stenglein ]
  * improve make_catalog_backup_awk in sqlite3 to dump catalog only once
    rather than for each line in bacula-dir.conf (LP: #614320)
 -- Scott Moser <email address hidden> Fri, 10 Feb 2012 10:04:35 -0500

Changed in bacula (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

given this file is in debian/ making upstream bug as invalid.

Changed in bacula:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.