Backing up catalog and other essential files for disaster recovery solution

588 views
Skip to first unread message

Francesco Morosinotto

unread,
Aug 20, 2015, 8:56:24 AM8/20/15
to bareos-users
Hello guys,

this is probably a stupid question but after browsing the web I was not able to find out a clear solution:

I have a main backup server and an offsite one;
every night I make some backup to the offsite location (just the essential files I want to be able to recover even if an earthquake would destroy my main server).

I know that I should also backup in the offsite location the postgresql database (Catalog) and the bootstrap data (not really sure about this)...
the point is that I'm not able now to backup the catalog:

I was planning to rsync the dump of the database (using a pre-job script) to my offsite backup server.
unfortunately trying to dump it using bareos script make_catalog_backup.pl or simply pg_dump will return me these errors:

/usr/lib/bareos/scripts$ sudo ./make_catalog_backup.pl MyCatalog
pg_dump: [archiver (db)] connection to database "bareos" failed: FATAL: Peer authentication failed for user "bareos"

$ sudo pg_dump bareos
pg_dump: [archiver (db)] connection to database "bareos" failed: FATAL: role "root" does not exist

$ sudo pg_dump bareos -U bareos
pg_dump: [archiver (db)] connection to database "bareos" failed: FATAL: Peer authentication failed for user "bareos".

As you can see in my bareos-dir.conf file there is no password set or needed..
[...]
Catalog {
Name = MyCatalog
# Uncomment the following lines if you want the dbi driver
# dbdriver = "dbi:postgresql"; dbaddress = 127.0.0.1; dbport =
#dbdriver = "postgresql"
dbdriver = "postgresql"
dbname = "bareos"
dbuser = "bareos"
dbpassword = ""
}
[...]


can somebody point me to the right direction??

Drepper

unread,
Aug 20, 2015, 9:30:34 AM8/20/15
to bareos-users
I'm a newbie on bareos but it may be a problem with the privileges that are not granted to bareos user, I had some similar issues and those lines from the official bareos user guide helped me a lot.

>su - postgres
>/usr/lib/bareos/scripts/create_bareos_database
>/usr/lib/bareos/scripts/make_bareos_tables
>/usr/lib/bareos/scripts/grant_bareos_privileges

Let's hope it helps

Francesco Morosinotto

unread,
Aug 20, 2015, 11:11:29 AM8/20/15
to bareos-users
Thank you for your reply;

being honest I don't know if there are any problem regarding bareos user permission: bareos works really great, it makes backup and it's able to restore backed up files...

Logging in as postrgres user it seems to give better results but it will stuck with a permission denied error:

/usr/lib/bareos/scripts/make_catalog_backup: 115: /usr/lib/bareos/scripts/make_catalog_backup: cannot create bareos.sql: Permission denied

What is the best way to backup the catalog outside the bareos system??

lst_...@kwsoft.de

unread,
Aug 21, 2015, 3:41:48 AM8/21/15
to bareos...@googlegroups.com

Zitat von Francesco Morosinotto <francesco....@riescoincucina.it>:

> Hello guys,
>
> this is probably a stupid question but after browsing the web I was
> not able to find out a clear solution:
>
> I have a main backup server and an offsite one;
> every night I make some backup to the offsite location (just the
> essential files I want to be able to recover even if an earthquake
> would destroy my main server).
>
> I know that I should also backup in the offsite location the
> postgresql database (Catalog) and the bootstrap data (not really
> sure about this)...
> the point is that I'm not able now to backup the catalog:
>
> I was planning to rsync the dump of the database (using a pre-job
> script) to my offsite backup server.
> unfortunately trying to dump it using bareos script
> make_catalog_backup.pl or simply pg_dump will return me these errors:
>
> /usr/lib/bareos/scripts$ sudo ./make_catalog_backup.pl MyCatalog
> pg_dump: [archiver (db)] connection to database "bareos" failed:
> FATAL: Peer authentication failed for user "bareos"

Looks like PostgreSQL...
Try with "sudo -u bareos ..." to execute the script as user "bareos"
which should be able to connect without password.

Regards

Andreas


Reply all
Reply to author
Forward
0 new messages