cron.d backup vs scheduled backup in the GUI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
TBT
Posts: 615
Joined: Wed May 18, 2011 1:26 pm

cron.d backup vs scheduled backup in the GUI

Post by TBT »

In preparation of a Nagios XI migration, we've built 8 new servers with a fresh install of XI. They have been sitting a few days and today we noticed the 100GB disk on each server was 100% full. Upon investigation we discovered /store/backups/mysql to be the culprit, more specifically a cron job was creating backups of the Databases.

Code: Select all

# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi

# Backup MySQL & PostgreSQL Databases
0   7 * * * root   /root/scripts/automysqlbackup
0   7 * * * root   /root/scripts/autopostgresqlbackup > /dev/null 2>&1
This raises a few questions....

1. Should this cron be enabled by default?
2. If cron is left enabled, how does this affect the Scheduled Backups in the GUI once enabled?
3. If Scheduled Backups in the GUI is enabled does it comment out the cron preventing double backup?
4. Are Scheduled Backups complete, eg: all databases and associated nagios directories?
Nagios XI 5.9.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
kfanselow
Posts: 241
Joined: Tue Aug 31, 2021 3:25 pm

Re: cron.d backup vs scheduled backup in the GUI

Post by kfanselow »

Hi TBT,

The auto backup scripts in cron are different from the backups that can be scheduled via the GUI. The backups scheduled via the GUI gather more components and configuration information for nagios and nagiosXI wheres the automysqlbackup or autopostgresqlbackup scripts gather full database backups alone. We have seen quite a few problems over the years that were the result of database corruption for a variety of reasons ,and people are not always reliable when it comes to performing backups. With that being said you can adjust the frequency of the backups in cron or turn them off all together if you like (not recommended). For more information I would recommend reviewing the scripts themselves, both the automysqlbackup script and the backup_xi script (usr/local/nagiosxi/scripts/backup_xi.sh) are fairly readable bash scripts. Hope this is helpful.


Thanks and Best Regards,
Keith
Locked