Page 1 of 1

cron.d backup vs scheduled backup in the GUI

Posted: Thu Jan 20, 2022 5:14 pm
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?

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

Posted: Fri Jan 21, 2022 12:10 pm
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