Bacula-users

Re: [Bacula-users] Cannot stat bacula.sql

2008-07-26 00:42:20
Subject: Re: [Bacula-users] Cannot stat bacula.sql
From: Kendall Shaw <kshaw AT kendallshaw DOT com>
To: Bacula Users <bacula-users AT lists.sourceforge DOT net>
Date: Fri, 25 Jul 2008 21:48:53 -0700
On Mon, 2008-07-21 at 11:49 +0800, Troy Daniels wrote:
> Hi,
> 
> On Sat, 2008-07-19 at 20:49 -0700, Kendall Shaw wrote:
> > On Tue, 2008-07-08 at 09:59 +0200, Arno Lehmann wrote:
> > > Hi,
> > > 
> > > 08.07.2008 06:13, Kendall Shaw wrote:
> > > > My job for backing up the catalog fails with:
> > > > 
> > > > Could not stat /var/bacula/bacula.sql: ERR=No such file or directory
> > > > 
> > > > If I run the RunBeforeJob command with the arguments it's given in the
> > > > job definition, it creates /var/bacula/bacula.sql.
> > > 
> > > Does the job report mention the run before job?
> > > 
> > > > Do you have any idea what the problem could be?
> > > 
> > > Well, it would be worth checking what happens when you, as the bacula 
> > > user, execute '/usr/local/libexec/bacula/make_catalog_backup bacula
> > > bacula'. Two likely reasons for that not to create the needed SQL dump 
> > > of the catalog are 1) wrong credetials to the database, i.e. you need 
> > > to specify the correct user and password, or 2) the dump goes to some 
> > > other place.
> > > 
> > > If the make_catalog_backup script runs without error messages, you 
> > > should have a look into that script and see where it puts the dump.
> > > 
> > > Arno
> > 
> > Bacula was being run as a user with nologin as it's shell. I tried
> > changing the bacula user's shell to ksh, but I still get the error about
> > not being able to stat bacula.sql. If I run the same command and same
> > arguments, as the bacula user, it creates bacula.sql, e.g.:
> > 
> > su _bacula
> > /usr/local/libexec/bacula/make_catalog_backup bacula bacula
> > 
> > Looking at the script, it runs psql and directs the output
> > to /var/bacula/bacula.sql. Is bacula checking for the file after it
> > deletes it? What can the problem be?
> > 
> 
> Near the top of the job log there should be some lines saying it's
> running the before job, as well as possibly the outcome from that. Does
> it give any indication that there has been a problem running the script
> there?

No.

> Also, is the database on the same server as the director or a different
> one?

The same.

> "RunBeforeJob" scripts are executed by the Director so if they different
> servers you'll need to update it to 'ClientRunBeforeJob' (from memory)
> 
> If you can provide the job log from one of these failed jobs to the
> list, maybe someone can spot the problem.

Thanks, here goes:

21-Jul 03:00 archie-dir JobId 18: BeforeJob: run command
"/usr/local/libexec/bacula/make_catalog_backup bacula bacula"
21-Jul 03:00 archie-dir JobId 18: Start Backup JobId 18,
Job=pokey-catalog.2008-07-21_03.00.27
21-Jul 03:00 archie-dir JobId 18: There are no more Jobs associated with
Volume "Vol0009". Marking it purged.
21-Jul 03:00 archie-dir JobId 18: All records pruned from Volume
"Vol0009"; marking it "Purged"
21-Jul 03:00 archie-dir JobId 18: Recycled volume "Vol0009"
21-Jul 03:00 archie-dir JobId 18: Using Device "pokey-storage"
21-Jul 03:00 archie-sd JobId 18: Recycled volume "Vol0009" on device
"pokey-storage" (/usr/local/archive/pokey), all previous data lost.
21-Jul 03:00 archie-dir JobId 18: Max Volume jobs exceeded. Marking
Volume "Vol0009" as Used.
21-Jul 03:06 pokey-fd JobId 18:      Could not
stat /var/bacula/bacula.sql: ERR=No such file or directory
21-Jul 03:00 archie-sd JobId 18: Job write elapsed time = 00:00:01,
Transfer rate = 0  bytes/second
21-Jul 03:00 archie-dir JobId 18: Bacula archie-dir 2.2.8 (26Jan08):
21-Jul-2008 03:00:19
  Build OS:               x86_64-unknown-openbsd4.3 openbsd 4.3
  JobId:                  18
  Job:                    pokey-catalog.2008-07-21_03.00.27
  Backup Level:           Full
  Client:                 "pokey-fd" 2.2.8 (26Jan08)
i686-pc-linux-gnu,debian,lenny/sid
  FileSet:                "pokey-catalog" 2008-07-07 03:00:00
  Pool:                   "pokey-pool" (From Job resource)
  Storage:                "pokey-archive" (From Pool resource)
  Scheduled time:         21-Jul-2008 03:00:00
  Start time:             21-Jul-2008 03:00:18
  End time:               21-Jul-2008 03:00:19
  Elapsed time:           1 sec
  Priority:               11
  FD Files Written:       0
  SD Files Written:       0
  FD Bytes Written:       0 (0 B)
  SD Bytes Written:       0 (0 B)
  Rate:                   0.0 KB/s
  Software Compression:   None
  VSS:                    no
  Storage Encryption:     no
  Volume name(s):         Vol0009
  Volume Session Id:      18
  Volume Session Time:    1215368484
  Last Volume Bytes:      626 (626 B)
  Non-fatal FD errors:    1
  SD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Backup OK -- with warnings

21-Jul 03:00 archie-dir JobId 18: Begin pruning Jobs.
21-Jul 03:00 archie-dir JobId 18: No Jobs found to prune.
21-Jul 03:00 archie-dir JobId 18: Begin pruning Files.
21-Jul 03:00 archie-dir JobId 18: No Files found to prune.
21-Jul 03:00 archie-dir JobId 18: End auto prune.

21-Jul 03:00 archie-dir JobId 18: AfterJob: run command
"/usr/local/libexec/bacula/delete_catalog_backup"

Kendall

> Cheers,
> 
> 
> Troy Daniels
> Systems Admin.
> iTouch Australia, a Buongiorno Company.
> 
> 
> > Kendall
> > 
> > > > Job {
> > > >   Name = asdf-catalog
> > > >   Type = Backup
> > > >   Level = Full
> > > >   FileSet = asdf-catalog
> > > >   Messages = Standard
> > > >   Pool = asdf-pool
> > > >   Client = asdf-fd 
> > > >   Schedule = daily-after-backup
> > > >   # This creates an ASCII copy of the catalog
> > > >   RunBeforeJob = "/usr/local/libexec/bacula/make_catalog_backup bacula
> > > > bacula"
> > > >   # This deletes the copy of the catalog
> > > >   RunAfterJob  = "/usr/local/libexec/bacula/delete_catalog_backup"
> > > >   Write Bootstrap = "/var/bacula/BackupCatalog.bsr"
> > > >   Priority = 11                   # run after main backup
> > > > }
> > > > 
> > > > Kendall
> > > > 
> > > > 
> > > > 
> > > > -------------------------------------------------------------------------
> > > > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> > > > Studies have shown that voting for your favorite open source project,
> > > > along with a healthy diet, reduces your potential for chronic lameness
> > > > and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> > > > _______________________________________________
> > > > Bacula-users mailing list
> > > > Bacula-users AT lists.sourceforge DOT net
> > > > https://lists.sourceforge.net/lists/listinfo/bacula-users
> > > > 
> > > 
> > 
> > 
> > -------------------------------------------------------------------------
> > 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
> 
> 


-------------------------------------------------------------------------
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