Scheduled backup fails to remove old backups

I see you filed bug https://www.virtualmin.com/node/23428 about this … I’ll follow up there.

Hello,

I notice the issue here https://www.virtualmin.com/node/23428 was marked as fixed, yet deletion seems to be failing for me now with the latest release. :slight_smile:

The backup server is an sftp server that is always on. Local backup works fine and deletes fine.

Listing directories gives me

sftp> ls -la
drwxr-xr-x 4 u46155 u46155 4 Nov 5 11:58 .
drwxr-xr-x 3 u46155 u46155 3 Apr 21 2012 …
drwxr-xr-x 2 u46155 u46155 59 Nov 2 05:54 02-11-2012
drwxr-xr-x 2 u46155 u46155 54 Nov 3 08:04 03-11-2012

I attach a screenshot of my backup settings. Nothing extraordinary I believe.

Hello,

My backup schedules have been failing to delete for weeks and weeks now. Nothing has changed that I know of except for virtualmin updates and CentOS updates. Something broke the delete old backups. It never happens and there are no errors that I can see.

I backup to localhost and it was working for years.

So anybody else still running into this?

Dennis

Hi
First, thank’s for this great software. I use it with pleasure.

I backup via ssh and deletion of old backups are not working. Would be nice, if someone could help!

Best regards
Steve

Sorry for bumping an old thread but I too have the same problems.

Using two locations for backup.

  1. NFS share with rw rights
  2. Local volume

On both locations, deletions are not working.

I do not have a big problems with this as I have plenty of space,but would love to see it fixed or at least pointed in the right direction.

Is assume that if you run ls -l on the parent of those backup directories that it shows them with the expected last-modified dates?

ls -l

total 276
drwxr-xr-x 2 nobody nogroup 4096 Apr 1 05:05 01-04-2014
drwx------ 2 nobody nogroup 4096 May 1 05:06 01-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 2 05:05 02-04-2014
drwx------ 2 nobody nogroup 4096 May 2 05:06 02-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 3 05:05 03-04-2014
drwx------ 2 nobody nogroup 4096 May 3 05:06 03-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 4 05:05 04-04-2014
drwx------ 2 nobody nogroup 4096 May 4 05:06 04-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 5 05:05 05-04-2014
drwx------ 2 nobody nogroup 4096 May 5 05:05 05-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 6 05:05 06-04-2014
drwx------ 2 nobody nogroup 4096 May 6 05:05 06-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 7 05:05 07-04-2014
drwx------ 2 nobody nogroup 4096 May 7 05:05 07-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 8 10:07 08-04-2014
drwx------ 2 nobody nogroup 4096 May 8 05:06 08-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 9 05:06 09-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 9 05:05 09-04-2014
drwx------ 2 nobody nogroup 4096 May 9 05:05 09-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 10 05:06 10-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 10 05:06 10-04-2014
drwx------ 2 nobody nogroup 4096 May 10 05:05 10-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 11 05:05 11-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 11 05:05 11-04-2014
drwx------ 2 nobody nogroup 4096 May 11 05:05 11-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 12 05:05 12-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 12 05:05 12-04-2014
drwx------ 2 nobody nogroup 4096 May 12 05:05 12-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 13 05:05 13-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 13 05:11 13-04-2014
drwx------ 2 nobody nogroup 4096 May 13 05:05 13-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 14 05:05 14-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 14 05:06 14-04-2014
drwx------ 2 nobody nogroup 4096 May 14 05:05 14-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 15 05:05 15-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 15 05:05 15-04-2014
drwx------ 2 nobody nogroup 4096 May 15 05:05 15-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 16 05:06 16-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 16 05:05 16-04-2014
drwx------ 2 nobody nogroup 4096 May 16 05:05 16-05-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 17 05:05 17-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 17 05:06 17-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 18 05:05 18-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 18 05:05 18-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 19 05:06 19-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 19 05:05 19-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 20 05:05 20-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 20 05:05 20-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 21 05:05 21-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 21 05:05 21-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 22 05:05 22-03-2014
drwxr-xr-x 2 nobody nogroup 4096 Apr 22 05:05 22-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 23 05:05 23-03-2014
drwx------ 2 nobody nogroup 4096 Apr 23 05:05 23-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 24 05:05 24-03-2014
drwx------ 2 nobody nogroup 4096 Apr 24 05:05 24-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 25 05:05 25-03-2014
drwx------ 2 nobody nogroup 4096 Apr 25 05:05 25-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 26 05:05 26-03-2014
drwx------ 2 nobody nogroup 4096 Apr 26 05:05 26-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 27 05:05 27-03-2014
drwx------ 2 nobody nogroup 4096 Apr 27 05:05 27-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 28 05:05 28-03-2014
drwx------ 2 nobody nogroup 4096 Apr 28 05:05 28-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 29 05:05 29-03-2014
drwx------ 2 nobody nogroup 4096 Apr 29 05:05 29-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 30 05:05 30-03-2014
drwx------ 2 nobody nogroup 4096 Apr 30 05:05 30-04-2014
drwxr-xr-x 2 nobody nogroup 4096 Mar 31 05:05 31-03-2014

That looks fine to me.

What message do you get when you try to run a backup? Does it try to clean up old backups but fail, or just say that no cleanup is needed?

XX servers backed up successfully, 0 had errors. 8 Virtualmin configuration settings backed up successfully.
Backup is complete. Final size was 7.15 GB.

Deleting backups from local file /XXX/Hosting Backup/Virtualmin/Daily/%d-%m-%Y older than 7 days …
… no backups to delete were found

Ok, so that means that it didn’t find any candidate files to backup.

Does the backup directory perhaps need to be mounted before each backup?

No, the directory is located on a NFS share, mounted on start-up, with read+write permissions and always available.
The same backup is executed on a local volume, physical hard drive inside the server, but with a limit of 60 backups stored instead of 7.
At the moment, there are 69 backups and Virtualmin still thinks “no backups to delete were found”.

First, I thought it can be a NFS problem, but it seems this occurs on normal volumes also.

I’m out of ideas as to why this would be happening. However, in the next Virtualmin release I will have it display more details as to why backups weren’t deleted, which should help debug this further.

Quick fix for my problem.
In Virtualmin, edit the Scheduled Backup and under “Schedule and Reporting” you will find a “Command to run after backup” setting.
Set it to: find /YourBackupPath -type d -ctime +7 -exec rm -rf {} ;

Where -ctime +7 is the number of days you want to keep. Anything older will be deleted.
Tested and it works.

i notice that the backup server is running VSFTPD, and the working virtualmin is running PROFTPD, so i have to shutdown the incorrect ftp server and start up proftpd like my working virtualmin to make sure that both are identical.
I will test this tonight and comment my results here tomorrow