Page 1 of 1

Fresh 5.2.3 install, no autopostgresqlbackup script?

Posted: Wed Feb 24, 2016 12:15 pm
by vAJ
Noticed some cron errors for autopostgresqlbackup:

Code: Select all

/bin/sh: /root/scripts/autopostgresqlbackup: No such file or directory
Sure enough. No file present. MySQL script is there and runs fine. Checked the install log, no reference to it. cron references that are called by install script create the job, but the dbbackups script fails to copy the file (it's not even in /tmp/nagiosxi/nagiosxi)

Code: Select all

[root@brnxip01 nagiosxi]# cat nagiosxi.cron.d
# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi

# Backup MySQL & PostgreSQL Databases
0   7 * * * root   /root/scripts/automysqlbackup
0   8 * * * root   /root/scripts/autopostgresqlbackup
9-dbbackups:

Code: Select all

[root@brnxip01 nagiosxi]# cat 9-dbbackups
#!/bin/bash -e

. ./xi-sys.cfg

# Was previous step completed?
if [ ! -f installed.selinux ]; then
        echo "SELinux was not configured - run previous script" >&2
        exit 1
fi

# Was this step already completed?
if [ -f installed.dbbackups ]; then
        echo "Database backups already configured - skipping."
        exit 0
fi

mkdir -p /store/backups/mysql /store/backups/nagiosxi /root/scripts
chown "$nagiosuser:$nagiosgroup" -R /store/backups/nagiosxi
cp nagiosxi/automysqlbackup /root/scripts

echo "Database backups configured OK"
touch installed.dbbackups
Do I need to grab this script or drop the cron job?

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Posted: Wed Feb 24, 2016 2:45 pm
by lmiltchev
Do I need to grab this script or drop the cron job?
You can just drop the cron job. Postgres is no longer used in the new installs of XI. The data is stored in the "nagiosxi" database in mysql instead. You can double check if this is the case on your system by running:

Code: Select all

echo '\d' | psql nagiosxi nagiosxi
and

Code: Select all

echo 'show tables;' | mysql -t -u root -pnagiosxi nagiosxi

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Posted: Wed Feb 24, 2016 2:51 pm
by vAJ
Sweet. When did I miss that change? I'll have to review changelog.

On a side note, the install scripts need to be sanitized to remove the addition of that cron job.

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Posted: Wed Feb 24, 2016 3:50 pm
by lmiltchev
On a side note, the install scripts need to be sanitized to remove the addition of that cron job.
You are absolutely right. I will discuss this with our developers. In my opinion these two cron jobs:

Code: Select all

0   7 * * * root   /root/scripts/automysqlbackup
0   8 * * * root   /root/scripts/autopostgresqlbackup
don't need to be set up by default. These backups "saved the day" in a few cases, where we needed to restore the databases for customers, but in the majority of the cases they just take lots of disk space. :)
BTW, both - mysqld & postgres db (on older systems) are backed up anyway when you run the "/usr/local/nagiosxi/scripts/backup_xi.sh" script.

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Posted: Wed Feb 24, 2016 3:59 pm
by vAJ
Exactly. I think we can lock this one up.