Scheduled backup fails to remove old backups


I’m having troubles with the setup I’ve created on a Virtualmin scheduled backup. It doesn’t seem to be removing the backup directories of old backups I inform it to remove after X number of days. The email report states -

“Deleting backups older than 1 days …
… no backups to delete were found”

Yet there’s directories spanning many days there. If I set the scheduled backup to “Single archive file” with strftime on it removes those compressed files. But sadly it doesn’t remove directories for some strange reason. I wish to use the newer “One file per server” backup format. The backups are being stored on the server itself for testing purposes until I can get it working.

The current setup I have is the following -

Local file or directory - /root/backup/%d-%m-%Y This names a newly created directory with the current date, several compressed files inside for each domain named “site1.tar.gz”, “site2.tar.gz” for example.

Use strftime = yes

Transfer files after they’ve backed up = yes

Backup format - One file per server

Create destination directory = yes

Delete old backups after 1 day.

Any assistance in getting the system to remove old backup directories will be greatly appreciated.

Virtualmin will delete old backup directories, but only if the dates on them are at least 1 day old. Note that it determines this by checking the actual last-modification times as shown by ls -l /root/backup, rather than the filenames.

If you list the /root/backup directory, do the dates on the sub-directories match up with their names? If not, perhaps something else is modifying them every day, and thus keeping Virtualmin from seeing them as old…

drwxr-xr-x 2 bk bk 4096 Sep 9 00:52 09-09-2009
drwxr-xr-x 2 bk bk 4096 Sep 10 00:55 10-09-2009
drwxr-xr-x 2 bk bk 4096 Sep 11 00:48 11-09-2009
drwxr-xr-x 2 bk bk 4096 Sep 12 00:51 12-09-2009
drwxr-xr-x 2 bk bk 4096 Sep 13 00:39 13-09-2009

The dates on the directories look proper… Mine is set to 3 days… But it never seems to check it properly. It’s becoming a problem as I’m having to manually clear it up or deal with exploded disks syndrome. EDS.

How are you doing the backups? Are they being stored locally on your Virtualmin server? Or are they being stored remotely, via FTP or SSH or so?


I am having the same problem - Virtualmin will not delete any backups for me either. My setup is the same, down to the day - I have instructed Virtualmin to delete backups older than one day, and it is not. I am using “Delete backups older than 1 day” as well.

Eric, the OP said his backups are currently being stored locally on his server (as are mine):

The backups are being stored on the server itself for testing purposes until I can get it working.

Jamie, ls -l shows the correct dates on my backup directories as well.

Any thoughts?

  • Acorp

Hi Acorp,

What are you entering as the backup destination? Typically it should be something like :


which gets converted to the current date when the backup is run.

Backup Location:


and for my incremental backups (which also aren’t being purged):




That looks OK.

I would be interested to see the output from the command :

ls -l /backups/virtualmin

[root@secure backup]# ls -al total 24 drwxr-xr-x 5 root root 4096 Sep 14 00:00 . drwxr-xr-x 22 root root 4096 Jul 17 15:43 .. drwxr-xr-x 2 root root 4096 Sep 12 00:15 20090912 drwxr-xr-x 2 root root 4096 Sep 13 00:15 20090913 drwxr-xr-x 2 root root 4096 Sep 14 00:15 20090914 [root@secure backup]#

server set to delete after 1 day

I am backing it up remotely to an FTP site. user/password/chmod all allow deletion, and when I FTP in with the same user/pass I can delete with no problems whatsoever.

Is this a Windows FTP server, or Linux?

linux here (centos 5.3)

Can the user Virtualmin is logging in via FTP as list the directory containing the backup sub-directories?

using a local directory here, no FTP

hello jamie,

first I have to say, that vmin and wmin are a great work! Thanks for it. I love to use it since years . . .

I have the same problem backing up vservers in single files. After the correct time to delete the old backup folders, I get an error-mail which says, that the directories to delete haven’t been empty.
That is -in fact- correct, because the directories contain several (vserver-)tars.
What do I have to do, that the ftp-client allows the deletion of (not empty) directories?
They reside on a nas-system (D-LINK 323 aka conceptronics CHSNAS3) with built-in linux ftp-server. I fear, that I will not be able to configure its behavior.

Thank you in advance.


It took me a little bit to figure this out, but this can be caused by the Directory Listing Style being set to MS-DOS style in Information Internet Services (assuming you are using IIS for your FTP server). You have to change it to UNIX style for Virtualmin to read the dates properly.

P.S. Sorry for bumping an old thread, but it looks like it was never answered and this was the first page I found when searching.


I am having the same problem. Remote backup via SSH - It all use to work fine, deleting old backups - and now for the last week it has stopped working? What could be causing this?

Anyone have any information?

Old backups not being deleted.

Not files, not directories.

Disk fills, further backups fail.

Happens with FTP (Linux, Centos 5) or local backups.

For local backups, I have pre and post commands to mount and dismount the backup filesystem.

Did anyone ever fix this? Or do I have to use a third-party backup solution?



If you have a post-backup command to immediately un-mount the backup filesystem, purging of old backups won’t work as it is done after the post-backup command is run…

Hi Jaime, thanks for the rapid response!

Number one, that doesn’t explain why it also happens on FTP and SSH backups.

Number two, I can’t think of a reason why you would want the deletion to happen after the post script, though there probably is one…

Should I submit a bug report?