Skip to main content

Examples

Examples

Recommended

Learn how to remove obsolete backup files using common Backup Cleanup scenarios.

Commandcusty cleanup backups

Category

Maintenance

Quick Command

custy cleanup backups

examplescleanupbackup

Overview​

The following examples demonstrate common ways to clean obsolete backup files.

Depending on your project's configuration, Backup Cleanup can remove commit backups, tag backups, or both while preserving the configured number of recent backups.


Common Examples

Examples

Practical command examples.

Clean All Backup Files

Remove obsolete backup files using the configured cleanup settings.

CLI
custy cleanup backups

Clean Commit Backups Only

Remove obsolete commit message backups only.

CLI
custy cleanup backups --type commit

Clean Tag Backups Only

Remove obsolete tag message backups only.

CLI
custy cleanup backups --type tag


Retention Examples

Examples

Practical command examples.

Keep Five Backups

Preserve only the five newest backup files.

CLI
custy cleanup backups --keep 5

Keep Twenty Backups

Retain a larger backup history.

CLI
custy cleanup backups --keep 20



Global Options

Global options are specified before the command.

Examples include:

Examples

Practical command examples.

Preview Cleanup

See what would happen without deleting backup files.

CLI
custy --dry-run cleanup backups

Debug Cleanup

Run Backup Cleanup with additional diagnostic information.

CLI
custy --debug cleanup backups



What's Next?

Continue to the Output page to learn how Custy reports the results of a Backup Cleanup operation.