cronjob of scheduled backup
Posted: Mon Oct 12, 2020 2:24 am
What's the path of cronjob to schedule systems backup locally as shown in attached screenshot?
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi -e "select * from xi_options where name like 'scheduled%backups';"Code: Select all
/usr/local/nagiosxi/scripts/backup_xi.sh -d /nagios/backupsHow to understand the following value for local backup which's output of above command?ssax wrote:There is no cronjob associated with it, the values are stored in the database as PHP serialized strings:
It essentially will run this (based on your output):Code: Select all
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi -e "select * from xi_options where name like 'scheduled%backups';"
Code: Select all
/usr/local/nagiosxi/scripts/backup_xi.sh -d /nagios/backups
It looks like there are some field identifiers in there that are of use to developers. You can see Unix timestamps for the last and next run in that string along with the time settings.How to understand the following value for local backup which's output of above command?
That next run is also available in the GUI."lastrun";i:1606068000;s:7:"nextrun";i:1606154400;} |
Code: Select all
sarCode: Select all
echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --tableCode: Select all
echo "SELECT relname as Table, pg_size_pretty(pg_total_relation_size(relid)) As Size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as ExternalSize FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;" | psql nagiosxi nagiosxiCode: Select all
| nagios_logentries | 1531.53 |
| nagios_notifications | 17024.00 |Code: Select all
mysql -uroot -pnagiosxi -h 127.0.0.1 -B nagios -e 'TRUNCATE TABLE nagios_logentries;'Code: Select all
mysql -uroot -pnagiosxi -h 127.0.0.1 -B nagios -e 'TRUNCATE TABLE nagios_statehistory;'Code: Select all
mysql -uroot -pnagiosxi -h 127.0.0.1 -B nagios -e 'TRUNCATE TABLE nagios_notifications;'Code: Select all
mysql -uroot -pnagiosxi -h 127.0.0.1 -B nagios -e 'DELETE FROM nagios_logentries WHERE logentry_time <= (NOW() - INTERVAL 6 MONTH);'Code: Select all
mysql -uroot -pnagiosxi -h 127.0.0.1 -B nagios -e 'DELETE FROM nagios_statehistory WHERE state_time <= (NOW() - INTERVAL 6 MONTH);'Code: Select all
mysql -uroot -pnagiosxi -h 127.0.0.1 -B nagios -e 'DELETE FROM nagios_notifications WHERE start_time <= (NOW() - INTERVAL 6 MONTH);'