Page 1 of 1
Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 7:34 am
by dflick
I SSH backups to a remote server daily from my Nagios server. I have the backup limit on the ssh page set to 7 but the server does not cleanup the old files causing the remote server disk to fill. The SSH user is able to send file and delete files on the remote server with no issues.
[caecd@localhost nagiosbackup]$ ls
ssh_test_secure_copy.txt
[caecd@localhost nagiosbackup]$ rm ssh_test_secure_copy.txt
[caecd@localhost nagiosbackup]$ ls
[caecd@localhost nagiosbackup]$
The backup logs seems to be OK:
03-03-2016 00:00:01 DEBUG: Running scheduled local backup ...
03-03-2016 00:00:01 INFO: Creating a local backup: nagiosxi.1456984801
03-03-2016 00:00:01 INFO: Too many backups! Limit is 7. Removing: nagiosxi.1428728401.tar.gz before proceeding with backup.
03-03-2016 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
03-03-2016 03:00:01 DEBUG: Running scheduled SSH backup ...
03-03-2016 03:00:01 DEBUG: Sending create local backup command to CmdSubsystem
The nagiosxi.1428728401.tar.gz file above was not removed from the remote server.
I am running 2.7 on CentOS6
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 1:54 pm
by tmcdonald
Are you on 2014R2.7 or 2012R2.7? This should have been fixed in 2014R2.1. Let us know your full version and we can test this out.
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 2:01 pm
by dflick
I am on 2014R2.7
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 3:15 pm
by lmiltchev
I tested this on Nagios XI 5.2.5 and "Scheduled Backups" component ver. 1.1.2. It worked as expected. I setup my "Backup Limit" to "2", and I have only two backups on the remote server.
Code: Select all
root@debian:/home/lmiltchev/backups# ls -la
total 300036
drwxrwxrwx 2 lmiltchev lmiltchev 4096 Mar 3 13:54 .
drwxr-xr-x 3 lmiltchev lmiltchev 4096 Mar 29 2015 ..
-rw-r--r-- 1 lmiltchev lmiltchev 153447159 Mar 3 13:47 nagiosxi.1457034422.tar.gz
-rw-r--r-- 1 lmiltchev lmiltchev 153463286 Mar 3 13:54 nagiosxi.1457034842.tar.gz
-rw-r--r-- 1 lmiltchev lmiltchev 110 Mar 3 13:03 ssh_test_secure_copy.txt
In my case, the backup limit was honored.
Remove all of the backups but let's say one or two. Watch the backup directory on the remote box to see if the backup number will exceed 7. If it does, try upgrading to the latest release of XI to see if this is going to fix the issue.
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 3:31 pm
by rkennedy
Also - does the remote SSH user have permission to delete files? One thing to check on top of what @lmiltchev mentioned.
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 3:38 pm
by dflick
Upgrading is really not an option at the moment. Is there anything I can do to troubleshoot the existing install? @rkennedy see my original post on ssh permission. It is tested and working.
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 5:13 pm
by lmiltchev
Do you have only the "SSH" scheduled backup set up in XI or you also have the "FTP" and/or "Local" backups set up? What are the "Backup Limit" values on all of them?
How many backups do you have on the remote server at the moment? Can you run the following commands on the remote box?
Code: Select all
ls -lad /path/to/the/backup/directory
ls -la /path/to/the/backup/directory
Re: Backup limit not honored for SSH backups
Posted: Thu Mar 03, 2016 10:53 pm
by dflick
FTP Backups: Disabled
SSH Backups: Enabled - Next Run: Fri, Mar 4th at 3:00 AM -06:00 CST
Local Backups: Enabled - Next Run: Fri, Mar 4th at 12:00 AM -06:00 CST
Last Backup Size: 360.41 MB
[root@localhost nagiosbackup]# ls
ssh_test_secure_copy.txt
[root@localhost nagiosbackup]# ls -lad
drwxrwxr-x 2 bexar bexar 8192 Mar 3 06:47 .
[root@localhost nagiosbackup]# ls -la
total 16
drwxrwxr-x 2 bexar bexar 8192 Mar 3 06:47 .
drwx------ 3 bexar bexar 4096 Oct 18 2014 ..
-rw-r--r-- 1 bexar bexar 110 Mar 3 06:47 ssh_test_secure_copy.txt
[root@localhost nagiosbackup]#
There is only one file as there were about 50 zero byte files that I deleted. I have gone through this exercise several times already so I know it will not delete the backups.
Re: Backup limit not honored for SSH backups
Posted: Fri Mar 04, 2016 1:05 pm
by lmiltchev
What is the "Scheduled Backups" component version that you see under the "Manage Components" page?
Admin->Manage Components
Do you see a new version available for download when you click on "Check for Updates"?