Crates.io | pirouette |
lib.rs | pirouette |
version | 0.5.1 |
created_at | 2025-04-13 22:45:06.76533+00 |
updated_at | 2025-09-05 11:37:25.669205+00 |
description | A log/backup rotation tool. |
homepage | |
repository | https://github.com/tquin/pirouette |
max_upload_size | |
id | 1632209 |
size | 78,887 |
A log and backup rotation tool.
⚠️ alpha software under active development - may break your stuff! ⚠️
The recommended installation method is with Docker Compose. You need to edit the volume mappings for the source
(what you want to take snapshots of), target
(where should pirouette store those snapshots), and config
(where the pirouette.toml
file can be found). Then, run docker compose up -d
to start pirouette.
services:
pirouette:
image: tquin/pirouette:latest
container_name: pirouette
environment:
PIROUETTE_CONFIG_FILE: /config/pirouette.toml
volumes:
- "/your/path/to/source:/source"
- "/your/path/to/target:/target"
- "/your/path/to/pirouette.toml:/config/pirouette.toml"
Alternatively, if you can't run a container, pirouette is also available as a binary Rust crate.
cargo install pirouette
All configuration for pirouette is done through a pirouette.toml
file. Pirouette will look for this file in this order:
PIROUETTE_CONFIG_FILE
environment variable, if set/config/pirouette.toml
${CWD}/pirouette.toml
Specifies the source data you want to take snapshots of. If using Docker, you can leave this as /source
and map it to the corresponding host path in your Compose file.
The path must already exist, or pirouette will return an error.
Key | Required | Value |
---|---|---|
path |
Yes | A path to an existing file or directory. |
Specifies the destination where you want your snapshots stored. If using Docker, you can leave this as /target
and map it to the corresponding host path in your Compose file.
If the target.path
doesn't already exist, pirouette will try to create it for you.
Key | Required | Value |
---|---|---|
path |
Yes | A path to a directory. |
This section defines how many copies of the source data pirouette should keep at different age intervals. While each individual key is optional and can be excluded, at least one of the keys must be provided.
Key | Required | Value |
---|---|---|
hours |
No* | An integer number of snapshots to keep. |
days |
No* | An integer number of snapshots to keep. |
weeks |
No* | An integer number of snapshots to keep. |
months |
No* | An integer number of snapshots to keep. |
years |
No* | An integer number of snapshots to keep. |
*At least one key must be provided
All options listed below are optional, and if excluded will have a default value.
Key | Value | Default | Notes |
---|---|---|---|
output_format |
directory tarball |
directory |
Determines whether snapshots retain their structure, or are compressed into a single .tgz file. |
log_level |
error warn info debug trace |
warn |
Set the logging level. |
dry_run |
true false |
false |
Determines if file system changes can occur. If true , will generate DEBUG -level logs instead. |
include |
List of glob patterns, eg: ["foo.txt", "foo/**"] |
[] (None) |
Only files in the source which match at least one of the include patterns will be snapshotted. |
exclude |
List of glob patterns, eg: ["foo/**/badfile"] |
[] (None) |
Only files in the source which match none of the exclude patterns will be snapshotted. |
You can test changes in a Docker container:
./docker-dev.sh