Description: Empty sub folders are deleted when the option to "Remove files older than" is selected.
Steps To Reproduce:
1. Create a Maintenance Plan to backup one database into a parent location with an empty subfoder.
2. Select the "remove files older than option"
3. Save and run the Maintenance Plan.
4. Note that the empty subfolder is deleted.
Actual Results: Litespeed will delete any empty subfolder it finds in the parent folder that holds the backup when this Maintenance Plan runs.
Expected Results: Empty sub folders should not be deleted (unless that parameter is specifically listed)
1. The t-sql for the LiteSpeed for SQL Server xp (from the Help under, xp_slsSmartCleanup):
Deletes the full and differential backups older than 28 days, delete log backups older than 2 days, allow deletions of the copy-only backups:
exec master.dbo.xp_slsSmartCleanup
@database = 'test'
, @BackupRetainDays = 28
, @LogRetainDays = 2
, @CopyOnlyBackups = 'AllowDeletes'
2. execute master.dbo.xp_slssqlmaint N'-D "AdventureWorks" -BkUpMedia DISK -DelBkUps 3DAYS -BkUpLog -UseDefDir -CrBkSubDir -BkExt "trn" -Logging 0 -CompressionLevel 2 -Default "%D_%T_%Y-%m-%d-%H%M%S.%EXT%" -NOOPTOLR -Exclude Deleted Offline LogShippng '
3. OR, if we want to delete the files as two separate steps, this would be the second step in the Maintenance Plan:
execute master.dbo.xp_slssqlmaint N'-MAINTDEL -DelDeviceType DISK -DELTYPE FileBkup -DELUSEAGE -DELUNIT "3" -DELUNITTYPE "DAYS" -DELSUBFOLDERS -DelEmptyFolder -DELEXTENSION "trn" -DELFOLDER "C:\Backup\2005\AdventureWorks\" '
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center