Catalog backup is broken in all default installs

Bug #115771 reported by david wood
2
Affects Status Importance Assigned to Milestone
bacula (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bacula

When bacula is installed, the default is to use sqlite3, and the default configuration for this database (at least) is broken, with respect to the catalog backup job.

This error will always be returned:

19-May 23:11 theory-dir: RunBefore: /usr/bin/sqlite3: unknown option: -u<user>.db
19-May 23:11 theory-dir: RunBefore: Use -help for a list of options.
19-May 23:11 theory-dir: BackupCatalog.2007-05-19_23.10.00 Fatal error: RunBeforeJob error: ERR=Child exited with code 1

Also, a (very difficult to remove) file "-u<user>.db" will be created in /var/lib/bacula. (I wasn't aware that backslash-escaping was broken in most shell commands (i.e. rm, mv, chmod) until I tried to remove this file. Go ahead, create one and try deleting it.)

The problem starts here, in the "BackupCatalog" job definition:

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

The "RunBeforeJob" passes "-u<user>" as $1, and this is not what the sqlite3 case in that script expects.

Simply passing "bacula" instead of "-u<user> -p<password>" would fix this problem. So would modifying the make_catalog_backup script, by changing the case for sql to simply hardcode "bacula" for $1 (line 17).

Revision history for this message
Ante Karamatić (ivoks) wrote :

We are in the process of rewriting make_catalog_backup

Changed in bacula:
status: New → In Progress
Revision history for this message
Ante Karamatić (ivoks) wrote :

This shouldn't be an issue anymore in Hardy. We have completely new script for catalog backup. I would suggest testing it, but you'll get hit by bug #204145.

Please wait for new version of bacula and try again. Thanks!

Ante Karamatić (ivoks)
Changed in bacula:
status: In Progress → Fix Released
Revision history for this message
david wood (david-wood) wrote :

It's impressive to see activity here, and I hope it does get fixed - I will certainly have a look at the next version. In the meantime, I've been using BackupPC (http://backuppc.sourceforge.net/), which seems superior to bacula in some ways anyway.

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.