Scheduled Backups not deleting

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Scheduled Backups not deleting

Post by OptimusB »

We are using local scheduled backups which is working. However it is not removing the backups past the backup limit.
I have this set to 15 days, however, it is not removing the older backups. I used the Test Permissions which report that nagios user/group likely does not have permissions. Permissions check below.

Code: Select all

[root@nagios backups]# ls -al
total 24
drwxr-xr-x 6 root   root   4096 Jan  9 13:53 .
drwxr-xr-x 4 root   root   4096 Mar 10 11:17 ..
drwxr-xr-x 2 nagios nagios 4096 Apr 28 00:08 dailys
drwxr-xr-x 5 root   root   4096 Apr 28 07:00 mysql
drwxr-xr-x 2 nagios nagios 4096 Apr 17 15:13 nagiosxi
drwxr-xr-x 5 root   root   4096 Apr 28 08:00 postgresql
[root@nagios backups]# cd dailys/
[root@nagios dailys]# ls -al
total 19547824
drwxr-xr-x 2 nagios nagios      4096 Apr 28 00:08 .
drwxr-xr-x 6 root   root        4096 Jan  9 13:53 ..
-rw-r--r-- 1 nagios nagios 309427666 Mar 15 00:04 nagiosxi.1426402801.tar.gz
-rw-r--r-- 1 nagios nagios 312765282 Mar 16 00:04 nagiosxi.1426489201.tar.gz
-rw-r--r-- 1 nagios nagios 316263798 Mar 17 00:05 nagiosxi.1426575602.tar.gz
-rw-r--r-- 1 nagios nagios 320036295 Mar 18 00:04 nagiosxi.1426662002.tar.gz
-rw-r--r-- 1 nagios nagios 323653138 Mar 19 00:03 nagiosxi.1426748402.tar.gz
-rw-r--r-- 1 nagios nagios 326588537 Mar 20 00:02 nagiosxi.1426834801.tar.gz
-rw-r--r-- 1 nagios nagios 329141919 Mar 21 00:03 nagiosxi.1426921201.tar.gz
-rw-r--r-- 1 nagios nagios 331562679 Mar 22 00:06 nagiosxi.1427007601.tar.gz
-rw-r--r-- 1 nagios nagios 333837295 Mar 23 00:04 nagiosxi.1427094001.tar.gz
-rw-r--r-- 1 nagios nagios 336375408 Mar 24 00:03 nagiosxi.1427180401.tar.gz
-rw-r--r-- 1 nagios nagios 338856985 Mar 25 00:03 nagiosxi.1427266801.tar.gz
-rw-r--r-- 1 nagios nagios 341289914 Mar 26 00:03 nagiosxi.1427353201.tar.gz
-rw-r--r-- 1 nagios nagios 348201589 Mar 27 00:04 nagiosxi.1427439601.tar.gz
-rw-r--r-- 1 nagios nagios 360924955 Mar 28 00:04 nagiosxi.1427526001.tar.gz
-rw-r--r-- 1 nagios nagios 374977230 Mar 29 00:06 nagiosxi.1427612402.tar.gz
-rw-r--r-- 1 nagios nagios 385689339 Mar 30 00:05 nagiosxi.1427698802.tar.gz
-rw-r--r-- 1 nagios nagios 393055930 Mar 31 00:09 nagiosxi.1427785201.tar.gz
-rw-r--r-- 1 nagios nagios 400307274 Apr  1 00:03 nagiosxi.1427871601.tar.gz
-rw-r--r-- 1 nagios nagios 407437875 Apr  2 00:03 nagiosxi.1427958001.tar.gz
-rw-r--r-- 1 nagios nagios 414223562 Apr  3 00:04 nagiosxi.1428044401.tar.gz
-rw-r--r-- 1 nagios nagios 420584233 Apr  4 00:05 nagiosxi.1428130802.tar.gz
-rw-r--r-- 1 nagios nagios 427020687 Apr  5 00:05 nagiosxi.1428217201.tar.gz
-rw-r--r-- 1 nagios nagios 432771607 Apr  6 00:05 nagiosxi.1428303601.tar.gz
-rw-r--r-- 1 nagios nagios 439270153 Apr  7 00:05 nagiosxi.1428390002.tar.gz
-rw-r--r-- 1 nagios nagios 446637148 Apr  8 00:05 nagiosxi.1428476401.tar.gz
-rw-r--r-- 1 nagios nagios 453033122 Apr  9 00:05 nagiosxi.1428562801.tar.gz
-rw-r--r-- 1 nagios nagios 457485227 Apr 10 00:05 nagiosxi.1428649201.tar.gz
-rw-r--r-- 1 nagios nagios 462132005 Apr 11 00:05 nagiosxi.1428735601.tar.gz
-rw-r--r-- 1 nagios nagios 466672074 Apr 12 00:06 nagiosxi.1428822001.tar.gz
-rw-r--r-- 1 nagios nagios 470605611 Apr 13 00:06 nagiosxi.1428908401.tar.gz
-rw-r--r-- 1 nagios nagios 474824642 Apr 14 00:05 nagiosxi.1428994801.tar.gz
-rw-r--r-- 1 nagios nagios 479053070 Apr 15 00:05 nagiosxi.1429081202.tar.gz
-rw-r--r-- 1 nagios nagios 485933491 Apr 16 00:06 nagiosxi.1429167602.tar.gz
-rw-r--r-- 1 nagios nagios 532691594 Apr 17 00:05 nagiosxi.1429254001.tar.gz
-rw-r--r-- 1 nagios nagios 545077363 Apr 18 00:07 nagiosxi.1429340402.tar.gz
-rw-r--r-- 1 nagios nagios 556328984 Apr 19 00:08 nagiosxi.1429426802.tar.gz
-rw-r--r-- 1 nagios nagios 565124930 Apr 20 00:07 nagiosxi.1429513201.tar.gz
-rw-r--r-- 1 nagios nagios 571734427 Apr 21 00:08 nagiosxi.1429599602.tar.gz
-rw-r--r-- 1 nagios nagios 582564708 Apr 22 00:09 nagiosxi.1429686001.tar.gz
-rw-r--r-- 1 nagios nagios 597703050 Apr 23 00:09 nagiosxi.1429772403.tar.gz
-rw-r--r-- 1 nagios nagios 612278845 Apr 24 00:06 nagiosxi.1429858802.tar.gz
-rw-r--r-- 1 nagios nagios 623675927 Apr 25 00:08 nagiosxi.1429945202.tar.gz
-rw-r--r-- 1 nagios nagios 630502588 Apr 26 00:12 nagiosxi.1430031602.tar.gz
-rw-r--r-- 1 nagios nagios 636138560 Apr 27 00:11 nagiosxi.1430118002.tar.gz
-rw-r--r-- 1 nagios nagios 642235590 Apr 28 00:08 nagiosxi.1430204402.tar.gz
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Scheduled Backups not deleting

Post by tmcdonald »

What XI version and scheduled backups component version are you using? The component version can be found under Admin -> Manage Components.
Former Nagios employee
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Scheduled Backups not deleting

Post by OptimusB »

XI version is R2.6 and Backup component is 1.0.8
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Scheduled Backups not deleting

Post by jdalrymple »

Need to have the x bit on /store for o - is that there?

Code: Select all

chmod o+x /store
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Scheduled Backups not deleting

Post by OptimusB »

The store permissions is as follows...

[root@nagios store]# ls -al
total 16
drwxr-xr-x 4 root root 4096 Mar 10 11:17 .
dr-xr-xr-x. 24 root root 4096 Mar 5 17:22 ..
drwxr-xr-x 6 root root 4096 Jan 9 13:53 backups
drwxr-xr-x 3 root root 4096 Mar 10 11:17 ucs-autodiscovery

I have not modified anything from the default and this was from the OVA files. I have a second instance that I just deployed with same permissions?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Scheduled Backups not deleting

Post by tgriep »

Could you post the scheduled backups log file here so we can review it?
Here is where it is.

Code: Select all

/usr/local/nagiosxi/var/components/scheduledbackups.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Scheduled Backups not deleting

Post by OptimusB »

Here is what the log has....

Code: Select all

04-24-2015 00:00:02 DEBUG: Running scheduled local backup ... 
04-24-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1429858802
04-24-2015 00:00:02 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
04-24-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
04-25-2015 00:00:02 DEBUG: Running scheduled local backup ... 
04-25-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1429945202
04-25-2015 00:00:02 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
04-25-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
04-26-2015 00:00:02 DEBUG: Running scheduled local backup ... 
04-26-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1430031602
04-26-2015 00:00:02 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
04-26-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
04-27-2015 00:00:02 DEBUG: Running scheduled local backup ... 
04-27-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1430118002
04-27-2015 00:00:02 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
04-27-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
04-28-2015 00:00:02 DEBUG: Running scheduled local backup ... 
04-28-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1430204402
04-28-2015 00:00:02 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
04-28-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Scheduled Backups not deleting

Post by tgriep »

Could you run the following on the Nagios server in a shell.

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Change the scheduled backups to happen a few minutes in to the future.
When the backup is run, you should see it's output in the cmdsubsys.log file.
Post the output and then you can put back the schedule to happen at your normal time.
Be sure to check out our Knowledgebase for helpful articles and solutions!
OptimusB
Posts: 146
Joined: Mon Oct 27, 2014 10:08 pm
Location: Canada
Contact:

Re: Scheduled Backups not deleting

Post by OptimusB »

Here it is...

Code: Select all

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS

CMDLINE=rm -rf /store/backups/nagiosxi/nagiosxi.1426402801.tar.gz
OUTPUT=
RETURNCODE=0
.PROCESSING COMMAND ID 2167...
PROCESS COMMAND: CMD=1117, DATA=a:2:{i:0;s:19:"nagiosxi.1430353201";i:1;s:22:"/store/backups/dailys/";}
CMDLINE=/usr/local/nagiosxi/scripts/backup_xi.sh -n nagiosxi.1430353201 -d /store/backups/dailys
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
tar: /usr/local/nagios/share/perfdata/S3FP01N: file changed as we read it
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.............................................tar: /usr/local/nagios/share/perfdata/L2E-LAN-B05: file changed as we read it
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tar: /usr/local/nagios/share/perfdata/ZGW-INT-B01: file changed as we read it
tar: /usr/local/nagios/share/perfdata/edmbchprn1/_HOST_.rrd: file changed as we read it
tar: /usr/local/nagios/share/perfdata/edmbchprn1: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS

===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/dailys/nagiosxi.1430353201.tar.gz
OUTPUT=Backup stored in /store/backups/dailys/nagiosxi.1430353201.tar.gz
RETURNCODE=0

PROCESSED 2 COMMANDS
from the backup log

Code: Select all

04-29-2015 17:20:01 DEBUG: Running scheduled local backup ...
04-29-2015 17:20:01 INFO: Creating a local backup: nagiosxi.1430353201
04-29-2015 17:20:01 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
04-29-2015 17:20:02 DEBUG: Sending create local backup command to CmdSubsystem
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Scheduled Backups not deleting

Post by jdalrymple »

What happens if you:

Code: Select all

su nagios -c "rm -rf /store/backups/nagiosxi/nagiosxi.1426402801.tar.gz"
Locked