Crates.io | rattlebeaver |
lib.rs | rattlebeaver |
version | |
source | src |
created_at | 2025-04-13 08:04:32.306977+00 |
updated_at | 2025-04-13 15:30:31.36809+00 |
description | Manage rolling backups |
homepage | |
repository | https://github.com/ArielHorwitz/rattlebeaver |
max_upload_size | |
id | 1631619 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Manage rolling backups for frequently generated backups.
When managing frequent backups, keeping the last X backups is not enough: reducing X quickly loses older yet still helpful backups, and increasing X produces many backups that are not helpful. rattlebeaver
allows to keep a sensible amount of backups for several timespans. Some example configurations:
Install using:
cargo install rattlebeaver
Every command in rattlebeaver will require specifying the TARGET_DIR
- the directory containing the rolling backups. This can be done using -t <TARGET_DIR>
or setting the RATTLEBEAVER_TARGET_DIR
environment variable.
A default configuration file will be generated inside the target dir as <TARGET_DIR>/rattlebeaver.config.toml
. This config will determine which backups are relevant and which are stale and need to be deleted.
To add a new rolling backup:
rattlebeaver add path/to/file-or-dir
To see existing backups:
rattlebeaver list
To delete stale backups:
rattlebeaver delete --execute
To understand how rattlebeaver determines which backups are stale, run
rattlebeaver list -a
to see what every backup entry fulfills according to the config. Entries that don't fulfill anything are considered stale and will be deleted by therattlebeaver delete
command.
The ranges.latest
determines how many of the last X backups to keep.
For the specific ranges (e.g. ranges.days
):
total
determines how many instances to consider for that range (e.g. 3 days)allow_sparse
determines whether the total includes empty instances (e.g. last 3 days that have backups or the last 3 days of the calendar)include_first
determines if the first backup of every instance should be keptinclude_last
determines if the last backup of every instance should be kept