How Can I Manage The Disk Space Used by .BAK Files Created when Executing Database Maintenance?
Question
How can I manage the disk space used by .BAK files created when executing database maintenance?
Applicable To
BarTender 2019 and later
Administration Console
Integration Builder
Answer
When you execute maintenance on the system database, you have the option to keep a backup file of the deleted records.
These .BAK files are stored over time in the specified path, so if not managed, the space they take up will grow quickly.
One way to keep these files under control is to build a custom integration that deletes them periodically.
Building your Integration
- Start by opening Integration Builder and click on Create New Integration
- For this purpose, use a Time Schedule integration because it allows you to define an action (delete files) that will repeat periodically
- Under Schedule, define when the action will be executed. For example, you can set the task to execute on the last Sunday of every month at 5:00 AM.
- Remove the default Print Document action and add a Delete File action
- Make the following changes to the Delete File action settings:
-
- Change to the Folder to look at the one in which .bak files are stored
- Optionally (to ensure that only .bak files are deleted), the File Pattern could be defined as *.bak
- Activate the Include Files Older Than option, so that only files older than 45 days (in this case) are deleted. This way we can still keep the more recent bak files
Additional Resources
Knowledge Base - Integration Platform