Exact file/directory name pattern for "Delete old backups"

The documentation text for Virtualmin's backup feature "Delete old backups" is rather extensive, still I'd like to ask what the precise pattern and procedure is when removing old backups.

The documentation say the "directory needs to be named like /backup/day-month-year, or the file like /backup/virtualmin-day-month-year.tar.gz". What if a directory is named "/backup/full-day-month-year"? Will that work too? What's the exact pattern required?

How is the age of the backup determined, from the file name pattern? Or the last-modification date of the file/directory?

Can I also use "year-month-day" in a directory name pattern? I'd actually prefer that, because I can then sort the directories by name and automatically have a correct date order.

Thanks in advance for insight! :)

Status: 
Closed (fixed)

Comments

As long as the directory pattern for the backup destination uses date substitution characters like %d and %M, it will be cleaned up by Virtualmin.

Internally, a backup destination like /backup/%d-%m-%Y is converted to a pattern like /backup/--* . Any files or directories that match that pattern will have their last modification time checked, and if older than the threshold they will be deleted..

Aah okay, so it takes the backup destination variable pattern which I use into account. That's great, I'll try that. Thanks!

Maybe you could clarify in the documentation that the "use substitution characters" switch needs to be active for this to work.

Virtualmin should already fail to save the scheduled backup if you enter a path using characters like %d without checking the "use substitution characters" checkbox.

Yeah it does, but that's not what I meant. :)

I meant, adding a hint that the "Delete old backups" option will only work when you have date substitution characters in the path. The documentation somewhat mentions it implicitly, but maybe an explicit explanation like you gave me would avoid confusion.

This is mentioned in the help page that pops up when you click on "Delete old backups"

I know it does. Please read what I wrote in my report:

Maybe you could clarify in the documentation that the "use substitution characters" switch needs to be active for this to work.

The documentation somewhat mentions it implicitly, but maybe an explicit explanation like you gave me would avoid confusion.

What the documentation says now reads just like examples to me, like "the directory should be named something like this with date numbers in the name". I could not derive the exact connection from that with the "use substitutions switch" and the pattern matching you describe to me.

You're right, that isn't very clear .. I will fix it in the next release.