Page 2 of 2

Re: Scheduled Backups not deleting

Posted: Thu Apr 30, 2015 11:27 am
by OptimusB
That seems to have worked. But that's not the backup file(s) it needs to clean....

Code: Select all

[root@nagios dailys]# su nagios -c "rm -rf /store/backups/nagiosxi/nagiosxi.1426402801.tar.gz"
[root@nagios dailys]# ls /store/backups/nagiosxi/nagiosxi.1426402801.tar.gz
ls: cannot access /store/backups/nagiosxi/nagiosxi.1426402801.tar.gz: No such file or directory
So here's what I see... it knows that there are older backups that it needs to remove. The log mentions it.

Code: Select all

4-29-2015 17:20:01 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426402801.tar.gz before proceeding with backup.
However the CMDLINE was to remove a backup in another folder?? (/store/backups/nagiosxi/? where as dailys aren't store there)

Code: Select all

CMDLINE=rm -rf /store/backups/nagiosxi/nagiosxi.1426402801.tar.gz
Also there are multiple files there that are older than 15days, but it doesn't indicate that it needs to remove them?

Code: Select all

-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
-rw-r--r-- 1 nagios nagios 656481292 Apr 29 00:09 nagiosxi.1430290802.tar.gz
-rw-r--r-- 1 nagios nagios 666346248 Apr 29 17:24 nagiosxi.1430353201.tar.gz
-rw-r--r-- 1 nagios nagios 670781922 Apr 30 00:15 nagiosxi.1430377201.tar.gz
Looks like it is removing from the "local backup archives" and not the daily?

Re: Scheduled Backups not deleting

Posted: Thu Apr 30, 2015 1:44 pm
by ssax
You are running into a bug in the scheduled backups component. One of the developers is looking into it and I'll update the post when I know more.

Re: Scheduled Backups not deleting

Posted: Thu Apr 30, 2015 3:08 pm
by scottwilkerson
@OptimusB -

Unzip the attached file and place in

Code: Select all

/usr/local/nagiosxi/cron/
cmdsubsys.zip
Also, you will need to unzip the following and place in

Code: Select all

/usr/local/nagiosxi/html/includes/components
scheduledbackups.zip
This should resolve the issue on the next run.

One thing to note is that by design, only 1 backup (the oldest file) will be deleted per run, so if you have 20 backups and change the threshold to 15, it will delete one and add one leaving you with 20

Re: Scheduled Backups not deleting

Posted: Fri May 01, 2015 11:00 am
by OptimusB
OK. So I have applied and tested this. It does remove the oldest backup from the proper directory now.

Code: Select all

05-01-2015 08:41:03 DEBUG: Sending create local backup command to CmdSubsystem
05-01-2015 08:52:01 DEBUG: Running scheduled local backup ...
05-01-2015 08:52:01 INFO: Creating a local backup: nagiosxi.1430495521
05-01-2015 08:52:01 INFO: Too many backups! Limit is 15. Removing: nagiosxi.1426489201.tar.gz before proceeding with backup.
05-01-2015 08:52:03 DEBUG: Sending create local backup command to CmdSubsystem
However I think the logic here could be improved on? As you mentioned, this is by design. If I had set to retain 20 backups and updated it to 15, it should remove everything that's older than 15 rather than leaving the original configured number of 20? If the retention settings goes up, this is fine, but lowering it would mean that it really isn't keeping the current set amount of backups, rather the maximum period set at any given time. Just a suggestion.

Re: Scheduled Backups not deleting

Posted: Fri May 01, 2015 12:50 pm
by ssax
I've created a feature request:

Code: Select all

NEW TASK ID 5568 created - Nagios XI Feature Request: XI Scheduled Backups - Specifying LIMIT should delete all backups past LIMIT
Can we mark this as resolved and lock the topic?

Re: Scheduled Backups not deleting

Posted: Mon May 04, 2015 12:08 pm
by OptimusB
Thanks! Will this "patch" be required in all our XI instances?
Yes, this can be locked.

Re: Scheduled Backups not deleting

Posted: Mon May 04, 2015 12:33 pm
by abrist
OptimusB wrote:Thanks! Will this "patch" be required in all our XI instances?
Yes, if you wish the housekeeping on old backups to perform as expected. This will be fixed in a future version, so pay attention to the XI release notes.
Locking.

Re: Scheduled Backups not deleting

Posted: Mon May 04, 2015 12:36 pm
by ssax
But only if they are running version 2014R2.6 or 2014R2.7.