Category: Shell

A tiny blog for DevOPS related items

Always in for coffee and cookies

Reset Bareos to a clean state

Whenever you want to reset your Bareos instance, for example, after a lot of testing you
can run just a few commands to accomplish this.

First, stop your Bareos services:

$ service bareos-dir stop
$ service bareos-sd stop
$ service bareos-fd stop

Then clean the files from your Bareos server:

$ rm  /var/lib/bareos/*

Go to the Bareos scripts directory and run these commands to drop and rebuild the database:

$ cd /usr/lib/bareos/scripts

$ ./drop_bareos_database
$ ./create_bareos_database
$ ./make_bareos_tables
$ ./grant_bareos_privileges

After you’re done, start the Bareos services and you should be good to go.

$ service bareos-dir start
$ service bareos-sd start
$ service bareos-fd start