| Crates.io | rattlebeaver |
| lib.rs | rattlebeaver |
| version | 0.1.1 |
| 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 |
| size | 51,942 |
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 -ato 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 deletecommand.
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