Arno Lehmann wrote: > Hi, > > On 5/31/2007 8:26 PM, Doug Breshears wrote: > >> I decided to create a new thread since it was different enough from the >> last one (Migration almost complete). >> >> ------------------------------------ >> Version: 2.0.3 >> Platform: Ubuntu Dapper (BTW, if anybody needs help creating debs for >> this I think I can help out) >> Problem: Migrate job failed with error ("database locked") when >> 'batched' with catalog backup run. >> > > I never saw that message in my installations, I believe... > > >> Sample Shell Script: >> -------------------- >> !/bin/sh >> cd /etc/bacula >> /usr/bin/bconsole << EOF >> run job=BackupCatalog pool=Daily-File level=Full yes >> run job=Migrate-Daily level=Full yes >> EOF >> -------------------- >> Background: The catalog backup failed last night because I did not >> change the config file correctly from 1.39 to 2.0.3. >> I fixed the problem and ran the above script, thinking that since I have >> the "Maximum Concurrent Jobs" set to 1, it would first run the backup >> then the migrate. But the Migrate job failed immediately (like it didn't >> wait at all) with the "Database locked" error while the BackupCatalog >> Job completed successfully sometime after that. >> After the Backup finished I was able to run the Migrate Job and it >> completed successfully as well. >> >> Question: Did this happen just because the backup catalog job was >> running when bconsole tried to schedule the Migration Job? If that is >> the case then it would not happen normally, right? >> > > I thnk youre right regarding both points. The process that locked the > catalog database was most probably the catalog dump. In my experience, > though, Bacula doesn't fail jobs you start, but the job setup is stalled > until the catalog can be accessed again. > > Here is one of many messages with the same ending.... 31-May 08:06 Ex1-dir: TermServ.2007-05-31_08.06.26 Fatal error: sql_create.c:91 sql_create.c:91 insert INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES ('TermServ.2007-05-31_08.06.26','TermServ','B','I','C','2007-05-31 08:06:25',1180623985) failed: database is locked
> There might be version differences, though, as I'm currently running 2.0.2. > > >> Question2: (Just to make things tougher) >> > > Very thoughtful of you, thanks! :-) > > >> If I change "Max Concurrent >> Jobs" to 4, is the scheduler smart enough to know that I don't want it >> to look at the jobs for migration until everything else is done, or >> should I do something like a "wait" command to force it? >> > > No and no. Use priorities instead. For example, I have my routine jobs > on priority 10, database dump jobs at 50 (or something), and the catalog > backup at 100. This ensures that the jobs run in he order I want, and > database dumps don't interfere with regular jobs. > > Ahhh, That one should have been obvious, sorry (great feature though..). >> Example: >> --------------------------------------------------- >> if [ $backup_type = "daily" ] >> then >> /usr/bin/bconsole << EOF >> run job=Ex1 SpoolData=yes pool=Daily-File level=Incremental yes >> run job=TermServ pool=Daily-File level=Incremental yes >> run job=Famous pool=Daily-File level=Incremental yes >> run job=Famous-Oracle pool=Daily-File level=Incremental yes >> run job=BackupCatalog pool=Daily-File yes >> wait <------ Insert this line?? >> > No, though it is a possibility. > >> run job=Migrate-Daily yes >> > I'd prefer to add 'priority=50' either to the command above, or even set > up the migration job to run at a higher priority number in the job > definition. > > >> EOF >> --------------------------------------------------- >> >> The above script snippet is what gets run (with the exception of the >> "wait" command) at 1am for my daily backups. >> > > Is there a special reason why you don't use the internal scheduler? > > When I first began, I could not figure out a way to do the daily/weekly/monthly (Incremental/Differential/Full) setup with the scheduler. Has something changed to make it easier? (Or is this another "Read the Manual again stupid" lesson?) If I remember correctly I had a hard time figuring out how to make one job replace another job depending on the date. It would be cool if a second version of the priority number could be used in this fashion to say, "If Multiple jobs are valid at any one time, then pick the one with the highest priority and do not schedule the others". In searching for a way to do this, I found a perl script that was "scheduled" with cron to fulfill this very purpose (http://www.georglutz.de/wiki/Bacula). I hacked it to meet my needs and it works. I just saw this on this (http://www.fosdem.org/2007/slides/maintracks/bacula.pdf) page. Schedule { Name = “Weekly Cycle” Run = Level=Full 1st sun at 2:05 Run = Level=Differential 2nd-5st sun at 2:05 Run = Level=Incremental mon-sat at 2:05 } And that is close to what I wanted. Not sure if I am just less picky now or if I did not know about it back then... Is there any "First/Last day of month" tags? Of course then we would have the conflict that would have to be resolved with some type of priority flag so multiple runs did not happen at once. > Arno > > >> Thanks for any help/insight you can provide. >> Doug >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Bacula-users mailing list >> Bacula-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bacula-user Thanks Arno, I am not sure how you manage to help so much but I do appreciate it. BTW: Full backup last night, ran great except for the migration. Can't find any indication of error, or that it even was scheduled. Must have to turn the debug level up? Doug ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users