Skip to main content

Overview

Backup Cleanup

Recommended

Automatically remove older backup files while preserving the most recent backups according to your project's retention policy.

Commandcusty cleanup backups

Category

Maintenance

Quick Command

custy cleanup backups

cleanupbackupmaintenance

Overview​

Backup Cleanup removes obsolete backup files created by Custy while preserving the most recent backups according to your configured retention policy.

This helps keep backup directories organized and prevents them from growing indefinitely during regular development.

Unlike Branch Cleanup, this operation affects only backup files and does not modify your Git repository.



What Backup Cleanup Does

Responsibilities

Find Backup Files

Locate backup files inside the configured backup directories.

Apply Retention Policy

Preserve the newest backups while selecting older backups for removal.

Remove Old Backups

Delete obsolete backup files that exceed the configured retention count.

Keep Workspace Organized

Prevent backup directories from accumulating unnecessary historical files.

Backup Cleanup

Backup cleanup process
Example output after removing obsolete backup files according to the configured retention policy.

Workflow Integration

Backup Cleanup can be executed directly whenever you want to clean backup directories.

It is also integrated into several Custy workflow pipelines, allowing backup maintenance to occur automatically after backup operations without requiring additional manual steps.



When Should You Use It?

Backup Cleanup is recommended when:

  • Backup directories contain many historical backup files.
  • You want to reclaim disk space.
  • You want to keep only the most recent backups.
  • You perform frequent backup operations during development.

In many workflows, Backup Cleanup is executed automatically, so manual execution is only necessary when you want to clean backup directories on demand.