When configuring a Backup Data Model Procedure step, administrators can define a Custom path for storing backup files. While substitution formulas add flexibility, using date or time variables in the Custom path can cause issues with the backup retention process.
The Issue
If you use Substitution Formulas that include date or time variables — such as @Date , or @Datetime — in the Custom path field, the backup directory name will change with each execution (for example, daily).
This causes a problem for the “Expiration Days” feature, which relies on a consistent folder path to identify and delete old backups. When the path changes every day, the retention logic cannot detect previous backups, leading to unused files accumulating over time.
Example Scenario
If one or more backups were performed on July 20th, 2023, and the backup step was executed again on July 28th, 2023 with the Expiration Days property set to 7, backups created on or before July 20th should be deleted.
However, if the Custom path contains a time- or date-based variable (e.g., @Date or @Time ), the folder name changes every day — like /Backup/2023-07-20/, /Backup/2023-07-21/, etc. — and the retention mechanism cannot identify which backups are older than seven days. This prevents cleanup and can cause unnecessary storage growth.
Supported Substitution Formulas
You can safely use the following Substitution Formulas in the Custom path field:
- @User
- @UserName
- @Database
- Environment variables such as %bss% and %computername%
Best Practice Recommendations
To ensure your backup and retention processes work correctly:
- Avoid using any time or date substitution formulas (@Date , @Datetime ) in the Custom path.
- Use consistent, static folder paths that remain the same across executions.
- Prefer environment variables such as %bss% and %computername% for defining context-aware, stable backup directories.
Example:
%bss%\Backups\
%bss%\%computername%\DataModelBackups\
These approaches ensure backup paths stay consistent, allowing the Expiration Days retention feature to function properly and prevent unnecessary storage usage.