Skip to main content

Options

Options

Recommended

Customize how Backup Cleanup removes obsolete backup files.

Commandcusty cleanup backups

Category

Maintenance

Quick Command

custy cleanup backups

cleanupbackupoptions

Overview

Backup Cleanup supports a small number of command-specific options.

Most projects rely on the values configured in config.toml, while command-line options can temporarily override those settings for a single execution.


Available Options

Command Options

Available command-line options.

--type-t
Optional

Select which backup category should be cleaned.
--keep-k
Optional

Specify how many of the newest backup files should be preserved.

Cleanup Types

The cleanup target determines which backup files are considered during the operation.

Available values are:

ValueDescription
commitClean commit message backups only.
tagClean tag message backups only.
allClean both commit and tag backups.

When no cleanup type is specified, Custy resolves the value from your project configuration.


Retention Count

The --keep option specifies the number of newest backup files that should be preserved.

For example:

  • --keep 5
  • --keep 10
  • --keep 20

Custy sorts backup files by age and removes only those exceeding the configured retention count.



Global Options

Backup Cleanup also supports Custy's global CLI options.

Examples include:

  • --dry-run
  • --debug
  • --log-level

Global options always appear before the command.

Example:

custy --dry-run cleanup backups

Configuration Resolution

When an option is omitted, Custy resolves its value using the following priority:

  1. Command-line option.
  2. Project configuration (config.toml).
  3. Built-in default value.

This resolution strategy provides predictable behavior while allowing temporary overrides when needed.


What's Next?

Continue to the Workflow page to understand how Backup Cleanup selects, retains, and removes obsolete backup files during execution.