autodelete pool

13 views
Skip to first unread message

DUCARROZ Birgit

unread,
Jun 14, 2020, 4:35:59 PM6/14/20
to bareos-users
Hi all,

How can I autodelete a pool (i.ex in a script)?

echo delete pool=Scratch yes | bconsole

--> does unfortunately not work

I can rm /etc/bareos/bareos-dir.d/pool/Scratch.conf, but doing so will
keep listing the pool in my storages list (see print-screen).

Thank you for any help.
Kind regards,
Birgit
Screen Shot 2020-06-14 at 22.34.51.png

Spadajspadaj

unread,
Jun 15, 2020, 3:32:25 PM6/15/20
to bareos...@googlegroups.com
Hi Birgit.

To be honest, I fail to see what would be the point of deleting a pool
from a script. If you need to delete a pool, you do it once,
interactively and everything's good.

Of course you can do a delete pool from bconsole but if you don't delete
it from the configuration it'll get recreated as soon as you reload the
configuration or restart the director. And ID of the pool will change.
(even if you're able to delete a pool having media assigned to it, which
I'm not sure you can do, those media would not get re-associated to a
new pool named the same as the old one).

But the bottom line is - why would you even want to do such a thing.
Especially considering that if you want to be able to batch-delete pools
you'd have to have a way to batch-create pools as well (otherwise what
would you be deleting?).

Can you please elaborate a bit more what you're trying to achieve?

DUCARROZ Birgit

unread,
Jun 16, 2020, 6:00:22 AM6/16/20
to Spadajspadaj, bareos-users
Hi Spadajspadaj,

First of all, thank you for your response.

I created a script which completely installs my server. The script is
meant to ease an eventual next installation on a new server (migration)
and at the same point it is meant to be my documentation.

The script installs a bareos server which will serve as archiving server
on single tapes.

Since I will and would not need incremental nor differential nor scratch
pools (I will only archive data using full-backup), I would like to
delete these pools using this initial installation script.

See also my post and answer from Philipp Storz:
https://groups.google.com/forum/#!searchin/bareos-users/Birgit$20Ducarroz%7Csort:date/bareos-users/g53BNdTat2s/YhlHeARHAgAJ

It would have been a nice feature to automate the deletion of these
pools directly at the installation.

So I wonder how I can manage this in my script.

Kind regards,
Birgit

Spadajspadaj

unread,
Jun 16, 2020, 7:32:29 AM6/16/20
to bareos-users
There's no point in creating those pools in the first place. Just define
a single pool in the config files and the daemon will create only this
defined pool.

If there's no Scratch pool defined, it will not be created.

https://docs.bareos.org/Configuration/Director.html#pool-resource

https://docs.bareos.org/Configuration/Director.html#scratch-pool

Notice the "if it exists" in description of Scratch Pool

Long story short then - don't create pools so you don't have to delete
them. Just set up a server with a defined pool(s) and you should be ok.

BTW, consider using some automation solution (for example - ansible) for
installing a server from scratch instead of own script.

DUCARROZ Birgit

unread,
Jun 19, 2020, 4:38:59 AM6/19/20
to Spadajspadaj, bareos-users
Hi Spadajspadaj,

Thank you for this. I'll have a look how to do is the best way for me.

Regards,
Birgit

On 17/06/20 09:16, Spadajspadaj wrote:
> Depends on what you mean by "standard installation" :-)
>
> Anyway, I believe the installer itself installs only empty database and
> the appropriate entries are getting created (if they are not already
> there) with a director reading the configuration on startup (or reload).
>
> So if you install the software, _don't_ start the director, prepare
> config files and then start the director daemon you should be on the
> safe side.
>
> On 16.06.2020 21:08, DUCARROZ Birgit wrote:
>> Thank you for your hints.
>>
>> So but if I understand right, the standard installation creates these
>> pools by default, and if I would not create them at the beginning, my
>> script has first to change the default config.
>>
>> In any way I have to adapt my script.
>>
>> Regards,
>> Birgit
Reply all
Reply to author
Forward
0 new messages