create_bareos_database takes no arguments? It uses "default" database name?

62 views
Skip to first unread message

Joe Nash

unread,
Feb 15, 2017, 10:19:30 AM2/15/17
to bareos-users
Hi,

I want to create a new blank database named NewDataBase.

And create_bareos_databases takes no arguments

How do I declare the name of the database to be created?

Thanks.

I could copy an old database structure. I have my reasons for wanting to use the script. I'm using multiple catalogs etc.

Jörg Steffens

unread,
Feb 15, 2017, 10:45:22 AM2/15/17
to bareos...@googlegroups.com
The script checks environment variables and/or read the current
configuration file, see
http://doc.bareos.org/master/html/bareos-manual-main-reference.html#CatalogDatabase

regards,
Jörg


--
Jörg Steffens joerg.s...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 630693-91
http://www.bareos.com Fax: +49 221 630693-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer:
S. Dühr, M. Außendorf, Jörg Steffens, P. Storz

Joe Nash

unread,
Feb 15, 2017, 3:16:24 PM2/15/17
to bareos-users
Thanks.

If another newbie is wondering, this short script worked for me:

#!/bin/bash
export db_name="MyNewDatabase"
./create_bareos_database
./make_bareos_tables



Message has been deleted

Stan Cruise

unread,
May 28, 2017, 8:38:01 PM5/28/17
to bareos-users

As one newbie to another, nice solution.

To Jorg above, unless I am missing something (likely), the reference you give is not relevant to 16.2, as the conf structure changed. I tried to work out the equivalent to no avail.
Could you provide an updated tip to adjust the db parms to allow the scripts to work? While Joe's script is a nice simple way to fix it, it's likely not what you guys had in mind.

dave dowless

unread,
May 29, 2017, 3:02:17 AM5/29/17
to Stan Cruise, bareos-users
Somewhere in the documentation it says the scripts will use the environmental variable "db_name" if it exists. If it does not exist, then scripts will fall back to the default. Search the documentation for db_name. It's in there somewhere. 

--
You received this message because you are subscribed to a topic in the Google Groups "bareos-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bareos-users/ushJ5XC2mm8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bareos-users+unsubscribe@googlegroups.com.
To post to this group, send email to bareos...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stan Cruise

unread,
May 29, 2017, 2:26:55 PM5/29/17
to bareos-users, scru...@gmail.com
On Monday, 29 May 2017 01:02:17 UTC-6, Joe Nash wrote:
> Somewhere in the documentation it says the scripts will use the environmental variable "db_name" if it exists. If it does not exist, then scripts will fall back to the default. Search the documentation for db_name. It's in there somewhere. 
>
>
> On Sun, May 28, 2017 at 8:38 PM, Stan Cruise <scru...@gmail.com> wrote:
> On Wednesday, 15 February 2017 13:16:24 UTC-7, Joe Nash  wrote:
>
> > Thanks.
>
> >
>
> > If another newbie is wondering, this short script worked for me:
>
> >
>
> > #!/bin/bash
>
> > export db_name="MyNewDatabase"
>
> > ./create_bareos_database
>
> > ./make_bareos_tables
>
>
>
> As one newbie to another, nice solution.
>
>
>
> To Jorg above, unless I am missing something (likely), the reference you give is not relevant to 16.2, as the conf structure changed. I tried to work out the equivalent to no avail.
>
> Could you provide an updated tip to adjust the db parms to allow the scripts to work? While Joe's script is a nice simple way to fix it, it's likely not what you guys had in mind.
>
>
>
>
>
> --
>
> You received this message because you are subscribed to a topic in the Google Groups "bareos-users" group.
>
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/bareos-users/ushJ5XC2mm8/unsubscribe.
>
> To unsubscribe from this group and all its topics, send an email to bareos-users...@googlegroups.com.
>
> To post to this group, send email to bareos...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Yes, I did use this approach from your previous post. It worked fine; many thanks.

My post was really asking the Bareos gurus to weigh in on whether there is an approach similar to the one documented in Chapter 31.1.2, but which is not compatible with 16.2 as the configuration structure changed. The implication was that the db_name can be specified in a .conf file somewhere, but maybe this is simply not the case and the only way is your way :).

Thanks again,

Stan

Dakota Pilot

unread,
May 29, 2017, 2:49:16 PM5/29/17
to bareos-users, scru...@gmail.com
On Monday, May 29, 2017 at 2:26:55 PM UTC-4, Stan Cruise wrote:
> On Monday, 29 May 2017 01:02:17 UTC-6, Joe Nash wrote:
> > Somewhere in the documentation it says the scripts will use the environmental variable "db_name" if it exists. If it does not exist, then scripts will fall back to the default. Search the documentation for db_name. It's in there somewhere. 

Under /etc/bareos-dir.d/catalog is a file called MyCatalog.conf which contains the information for the default MyCatalog. You can create your own MyDatabase.conf (or whatever) file for your database.Then in the jobs resource you can specify Catalog = MyDatabase and Bareos will use your database. I haven't tried it but the docs indicate that is what should happen.

Stan Cruise

unread,
May 29, 2017, 3:00:45 PM5/29/17
to bareos-users, scru...@gmail.com
Yes I did define a new Catalog, and I referred to it in the Client .conf file. In the docs for the Job resource (9.2), the Catalog directive indicates : "This specifies the name of the Catalog resource to be used for this Job. When a Catalog is defined in a Job it will override the definition in the Client." I did not specify it in the Job, expecting the Client to take effect.
I can try this in the Job to see if it works.

Dakota Pilot

unread,
May 29, 2017, 4:01:42 PM5/29/17
to bareos-users, scru...@gmail.com
Interesting. I just looked for it under the job. Let us know how it works.

I assume you reloaded in the console after making the change? If that doesn't work try restarting the director. I've found with the storage daemon I have to restart it when I make changes in the devices since a reload doesn't seem to help.

Stan Cruise

unread,
May 29, 2017, 4:02:59 PM5/29/17
to bareos-users, scru...@gmail.com
Just to be clear, once the db is created, the Catalog definition in the Client works fine. It even works in webui (after adjusting Directors.ini). My discussion is creating the db in the first place using the scripts.

Dakota Pilot

unread,
May 29, 2017, 4:27:19 PM5/29/17
to bareos-users, scru...@gmail.com
Ahh, I see. I missed that. Sorry. That is a problem being able to create a different database so for now it looks like the scripts have to be used. It would be a nice option to have for the Bareos db creation.

Glad to know the catalog works.

Stan Cruise

unread,
May 29, 2017, 5:18:59 PM5/29/17
to bareos-users, scru...@gmail.com
On Monday, 29 May 2017 14:27:19 UTC-6, Dakota Pilot wrote:
> Ahh, I see. I missed that. Sorry. That is a problem being able to create a different database so for now it looks like the scripts have to be used. It would be a nice option to have for the Bareos db creation.
>
> Glad to know the catalog works.

Thanks again for the quick reply! We are aligned in our thinking :).

I don't really have trouble using the db setup script, and manually changing the env variable, but it looked like in pre-16.2 there was a way to set some conf with the new db name, and then the create database script would pick up this new db name from the conf and then create the db without having to manually change the env variable. If this was never the case then so be it. It's not a problem manually adjusting the env variable; once one knows to do so .... :).

Dakota Pilot

unread,
May 29, 2017, 5:41:19 PM5/29/17
to bareos-users, scru...@gmail.com

We could pass the name as an argument to the script but it's good to know about the script.

Reply all
Reply to author
Forward
0 new messages