rustic Documentation

repository·main·Indexed 23 days ago

https://github.com/rustic-rs/rustic

rustic is a high-performance, encrypted, and deduplicated backup tool written in Rust. It is designed as a feature-rich alternative to restic while maintaining full compatibility with the restic repository format. The project includes a CLI binary and a modular ecosystem of crates, including rustic_core, rustic_backend, rustic_scheduler, and rustic_server.

Tokens
17.3K
Snippets
15
Records
148
Agent score
84%

What's inside rustic

  1. Overview of rustic

    main

    rustic is a fast, encrypted, and deduplicated backup tool. It is a complete new implementation inspired by restic but aims for faster development and more features.

    Key compatibility note: rustic reads and writes the identical repository format used by restic. This means you can use restic to verify backups made with rustic and vice versa, allowing you to switch between them without migrating data.

  2. Configure rustic using TOML profiles

    main
    rustic uses TOML files to define backup options through various sections and attributes. A configuration profile is organized into sections such as [global], [repository], [backup], and [forget]. These sections control the behavior of different commands and sources.
  3. Explore the rustic ecosystem crates

    main

    The rustic ecosystem is composed of several specialized crates that provide core functionality, backend support, scheduling, and server implementations. Developers can use these individual crates to build or extend applications within the ecosystem.

    Available Crates

    • rustic_core: Provides the core functionality for the entire ecosystem.
    • rustic_backend: A library designed to support various backends used by rustic and rustic_core.
    • rustic_scheduler: Provides scheduling functionality.
    • rustic_server: A server implementation that allows rustic to support multiple clients during backup operations.
    • rustic_testing: (Not published on crates.io) Provides testing functionality for the ecosystem.
  4. Locate and use rustic configuration profiles

    main

    Configuration files (TOML) can be stored in the user's local config directory (e.g., ~/.config/rustic/) or a global config directory (e.g., /etc/rustic/).

    You can specify a custom configuration file using the -P flag followed by the profile name.

    Additionally, you can enable environment variable substitution within your configuration files by using the profile-substitute-env option.

  5. Install rustic from source

    main

    You can install the latest development version directly from the GitHub repository. Warning: This version may be unstable.

    cargo install --git https://github.com/rustic-rs/rustic.git rustic-rs
  6. Configure Backup Options `[backup]`

    main

    The [backup] section defines default settings for all backup operations. These can be overridden in specific [[backup.snapshots]] entries.

    Key attributes:

    • description: Description for the snapshot.
    • exclude-if-present: Array of filenames that, if present, exclude their parent directory.
    • git-ignore: If true, uses .gitignore rules.
    • globs: Array of globs for inclusion/exclusion.
    • label / tags: Metadata for the snapshot.
    • skip-if-unchanged: Skip saving if identical to the parent.

    Snapshot-specific configuration: Use [[backup.snapshots]] to define specific sources and overrides:

    [[backup.snapshots]]
    name = "myid"
    sources = ["/dir1", "/dir2"]
    hooks = { run-before = ["echo test"] }