When creating scheduled backups that use strftime style substitutions, the delete old backups functionality does not function properly. I am admittedly unsure if this is a feature request or a bug, however, I personally consider it a bug since a feature essentially fails to function as one would expect given the options presented to the user.
Essentially, if the path specified is something like /backup/%Y-%m-%d which we use because we want to backup each virtual server individually for the ability to more granularly restore if necessary. When using this style path, the delete older backup function, only checks the current "substituted" directory path, which means that older backups are never deleted from a different day.
For example, if a backup was made on 3/24/2021 and the delete older than is set to 5 days, and after a few days of backups run, a backup is performed on 3/30/2021, the backup made on 3/24/2021 should now be deleted based on the configured settings.
However, the virtualmin backup routine that runs on 3/30/2021 only checks the /backup/2021-03-30 path for older backups which results in none being found. Therefore, older backups never get deleted and the potential to fill up the drive exists without manual intervention.
When using strftime substitution, the Virtualmin routine should check all substituted paths that would have been used over the previous periods. I understand that the potential issue may be, how far back and how many paths do you check because of the potential number of configuration options may make this impossible to know. IE, if someone has monthly backups configured, but a setting for delete backups older than 5 days, should Virtualmin go back 30 days to check this path and remove it? I believe that the answer is that for strftime substitution to work properly, a user almost certainly needs to use the "create destination directory" option as well. I would propose that anytime during a backup routine that Virtualmin needs to create a destination directory, the directory path that was created should be stored in the database and / or a config file somewhere so that a future scheduled backup routine can reference the created paths and check them for old backup files. If after checking for old backup files, the directory is empty, the directory should be deleted as well and the reference to it removed from the database / config file to avoid checking that the path again in the future. Finally, for completeness, the routine should also check for the existence of the path in the first (in case a user manually removes a backup) and remove it from the database / config file if it doesn't exist.