Skip to main content

Managing Backups

Managing Backups

Maintenance Journey

Protect Custy's commit and tag message files and keep their timestamped history within an intentional retention policy.

Commandcusty backup

Category

User Guide

Quick Command

custy backup <commit|tag|all>

message filestimestamped copiesretentionrestore

Goal​

Custy backups preserve configured commit-message and tag-message files before you edit conventions or prepare releases. They are focused recovery copies, not full project, repository, database, or remote backups.


Choose the Backup Scope

Backup Commands

Commit Message

custy backup commit preserves the configured commit-message file.

Tag Message

custy backup tag preserves the configured tag-message file.

Both Messages

custy backup all runs both focused backup profiles.

Retention Cleanup

custy cleanup backups removes older copies while keeping the configured number.

Recommended Backup Journey

Protect and Retain

1
Review source and destination paths
Confirm message files and their separate backup directories in project configuration.
completed
2
Preview creation
Dry-run the selected backup command and confirm the timestamped target.
completed
3
Create the backup
Run the focused or all-message backup command normally.
current
4
Verify the copy
Confirm the expected file exists and contains the intended source content.
pending
5
Preview retention cleanup
Dry-run cleanup before removing older backups.
pending
Backup both message files
bash
custy --dry-run backup all
custy backup all

Backups use timestamped names derived from the source stem. If the configured source file is missing, Custy skips that backup rather than inventing content.


Retention and Cleanup

The generated configuration keeps the 10 newest files in each selected backup category. --keep temporarily overrides that count; --type selects commit, tag, or all.

Preview and apply retention
bash
custy --dry-run cleanup backups --type all --keep 10
custy cleanup backups --type all --keep 10

Review the configured backups_commit and backups_tag directories before cleanup. Location and retention are separate settings.



Restore a Message File

Custy currently creates and cleans these backups; restoration is a deliberate file operation performed by the user. To restore safely:

  1. Stop any active Custy workflow.
  2. Identify the correct timestamped backup.
  3. Compare it with the active message file.
  4. Preserve the current active file if it may still be needed.
  5. Copy the reviewed backup content into the configured active message file.
  6. Run the relevant validation or dry-run before continuing.

Do not restore a .bak.txt file based only on its timestampβ€”inspect its content and verify whether it belongs to commit or tag messaging first.


Backup Checklist

Before You Begin

  • Source existsRequired

    The configured commit or tag message file exists and contains the version you intend to preserve.

  • Destination is correctRequired

    Commit and tag backups resolve to the intended separate directories.

  • Retention is sufficientRequired

    The keep count preserves enough history for your workflow.

  • The copy is verifiedRequired

    Inspect the new backup before changing the source file.

  • Cleanup is previewedRequired

    Use dry-run before removing older recovery copies.


Continue