0

When running the BackupCatalog job in my Bacula installation it throws the following warning:

Could not stat /var/lib/bacula/bacula.sql: ERR=No such file or directory

I've run this manually:

/etc/bacula/scripts/make_catalog_backup bacula bacula

and it did create /var/lib/bacula/bacula.sql, but when I run the job it gets deleted. Any ideas what's going on?

The whole output looks like this:

15-Dec 17:50 u2.simplificator.com-dir JobId 13: BeforeJob: run command "/etc/bacula/scripts/make_catalog_backup bacula bacula"
*
15-Dec 17:50 u2.simplificator.com-dir JobId 13: Start Backup JobId 13, Job=BackupCatalog.2010-12-15_17.50.31.15
15-Dec 17:50 u2.simplificator.com-dir JobId 13: Using Device "FileStorage"
15-Dec 17:50 u4.simplificator.com-sd JobId 13: Volume "u4-0044" previously written, moving to end of data.
15-Dec 17:50 u4.simplificator.com-sd JobId 13: Ready to append to end of Volume "u4-0044" size=487818529
15-Dec 17:50 u2.simplificator.com-fd JobId 13:      Could not stat /var/lib/bacula/bacula.sql: ERR=No such file or directory
15-Dec 17:50 u4.simplificator.com-sd JobId 13: Job write elapsed time = 00:00:01, Transfer rate = 0  bytes/second
15-Dec 17:50 u2.simplificator.com-dir JobId 13: Bacula u2.simplificator.com-dir 2.4.4 (28Dec08): 15-Dec-2010 17:50:38
  Build OS:               x86_64-pc-linux-gnu debian lenny/sid
  JobId:                  13
  Job:                    BackupCatalog.2010-12-15_17.50.31.15
  Backup Level:           Full
  Client:                 "u2.simplificator.com-fd" 2.4.4 (28Dec08) x86_64-pc-linux-gnu,debian,lenny/sid
  FileSet:                "Catalog" 2010-12-15 17:48:31
  Pool:                   "u4-pool" (From Job resource)
  Storage:                "u4.simplificator.com-sd" (From Job resource)
  Scheduled time:         15-Dec-2010 17:50:30
  Start time:             15-Dec-2010 17:50:36
  End time:               15-Dec-2010 17:50:38
  Elapsed time:           2 secs
  Priority:               11
  FD Files Written:       0

UPDATE: I've tried running the command as bacula to make sure there were no permission errors and it worked. I did like this:

sudo -u bacula /etc/bacula/scripts/make_catalog_backup bacula bacula
Pablo Fernandez
  • 7,438
  • 25
  • 71
  • 83

1 Answers1

1

Sounds like a permission or environment problem. Is the cron job running as root? Try adding some debugging messages into the /etc/bacula/scripts/make_catalog_backup script to catch where it creates the file and if there are any errors.

dmah
  • 516
  • 3
  • 5
  • 1
    It isn't a cron job. It is a script run before the backup job runs. Whoever the `bacula-dir` daemon runs as needs to be able to write to `/var/lib/bacula/`. (BTW if you don't have a valid backup of the catalog you'll suffer greatly when your bacula machine dies.) – Mark Wagner Dec 15 '10 at 23:56