{"id":15728706,"url":"https://github.com/rustic-rs/rustic_core","last_synced_at":"2026-04-05T10:02:00.687Z","repository":{"id":195573436,"uuid":"693194728","full_name":"rustic-rs/rustic_core","owner":"rustic-rs","description":"rustic_core - library for fast, encrypted, deduplicated backups that powers rustic-rs","archived":false,"fork":false,"pushed_at":"2026-02-03T22:58:30.000Z","size":2166,"stargazers_count":68,"open_issues_count":62,"forks_count":28,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-02-04T11:19:46.729Z","etag":null,"topics":["backups","deduplicated","encrypted","library","restic","rust","rustic"],"latest_commit_sha":null,"homepage":"https://rustic.cli.rs/ecosystem/rustic-core/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustic-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-18T14:34:57.000Z","updated_at":"2026-02-03T22:56:10.000Z","dependencies_parsed_at":"2024-01-18T09:03:02.266Z","dependency_job_id":"7bd5af1a-96a6-4665-b5fd-2bc9eb9d173e","html_url":"https://github.com/rustic-rs/rustic_core","commit_stats":{"total_commits":398,"total_committers":15,"mean_commits":"26.533333333333335","dds":0.6180904522613065,"last_synced_commit":"22a898cff62e9fb5a92020a90d8119dc8824dd1d"},"previous_names":["rustic-rs/rustic_core"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/rustic-rs/rustic_core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustic-rs%2Frustic_core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustic-rs%2Frustic_core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustic-rs%2Frustic_core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustic-rs%2Frustic_core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustic-rs","download_url":"https://codeload.github.com/rustic-rs/rustic_core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustic-rs%2Frustic_core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29345433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T20:11:40.865Z","status":"ssl_error","status_checked_at":"2026-02-11T20:10:41.637Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backups","deduplicated","encrypted","library","restic","rust","rustic"],"created_at":"2024-10-03T23:05:24.911Z","updated_at":"2026-02-11T21:10:55.173Z","avatar_url":"https://github.com/rustic-rs.png","language":"Rust","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/rustic-rs/assets/main/logos/readme_header_core.png\" height=\"400\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cb\u003eLibrary for fast, encrypted, and deduplicated backups\u003c/b\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://crates.io/crates/rustic_core\"\u003e\u003cimg src=\"https://img.shields.io/crates/msrv/rustic_core\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://crates.io/crates/rustic_core\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/rustic_core.svg?label=core\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://crates.io/crates/rustic_backend\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/rustic_backend.svg?label=backend\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://docs.rs/rustic_core/\"\u003e\u003cimg src=\"https://img.shields.io/docsrs/rustic_core?style=flat\u0026amp;labelColor=1c1d42\u0026amp;color=4f396a\u0026amp;logo=Rust\u0026amp;logoColor=white\" /\u003e\u003c/a\u003e\u003c/br\u003e\n\u003ca href=\"https://codecov.io/gh/rustic-rs/rustic_core\" \u003e\u003cimg src=\"https://codecov.io/gh/rustic-rs/rustic_core/graph/badge.svg?token=M3KHH6XKNM\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/rustic-rs/rustic_core/blob/main/\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://crates.io/crates/rustic_core\"\u003e\u003cimg src=\"https://img.shields.io/crates/d/rustic_core.svg\" /\u003e\u003c/a\u003e\n\u003cp\u003e\n\n## About\n\nThis library is powering [rustic-rs](https://crates.io/crates/rustic-rs). A\nbackup tool that provides fast, encrypted, deduplicated backups. It reads and\nwrites the `restic` repository format, which is described in their design\ndocument.\n\n**Note**: `rustic_core` is in an early development stage and its API is subject\nto change in the next releases. If you want to give feedback on that, please\nopen a thread in our\n[discussions](https://github.com/rustic-rs/rustic/discussions).\n\n## Contact\n\nYou can ask questions in the\n[Discussions](https://github.com/rustic-rs/rustic/discussions) or have a look at\nthe [FAQ](https://rustic.cli.rs/docs/FAQ.html).\n\n| Contact       | Where?                                                                                                          |\n| ------------- | --------------------------------------------------------------------------------------------------------------- |\n| Issue Tracker | [GitHub Issues](https://github.com/rustic-rs/rustic_core/issues/choose)                                         |\n| Discord       | [![Discord](https://dcbadge.vercel.app/api/server/WRUWENZnzQ?style=flat-square)](https://discord.gg/WRUWENZnzQ) |\n| Discussions   | [GitHub Discussions](https://github.com/rustic-rs/rustic/discussions)                                           |\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nrustic_core = \"0\"\n```\n\n## Crate features\n\nThis crate exposes a few features for controlling dependency usage:\n\n- **cli** - Enables support for CLI features by enabling `merge` and `clap`\n  features. *This feature is disabled by default*.\n- **merge** - Enables support for merging multiple values into one, which\n  enables the `conflate` dependency. This is needed for parsing commandline\n  arguments and merging them into one (e.g. `config`). *This feature is disabled\n  by default*.\n- **clap** - Enables a dependency on the `clap` crate and enables parsing from\n  the commandline. *This feature is disabled by default*.\n\n## Examples\n\n### Example: Initializing a new repository\n\n```rust\nuse rustic_backend::BackendOptions;\nuse rustic_core::{ConfigOptions, KeyOptions, Repository, RepositoryOptions};\nuse simplelog::{Config, LevelFilter, SimpleLogger};\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    // Display info logs\n    let _ = SimpleLogger::init(LevelFilter::Info, Config::default());\n\n    // Initialize Backends\n    let backends = BackendOptions::default()\n        .repository(\"/tmp/repo\")\n        .to_backends()?;\n\n    // Init repository\n    let repo_opts = RepositoryOptions::default().password(\"test\");\n    let key_opts = KeyOptions::default();\n    let config_opts = ConfigOptions::default();\n    let _repo = Repository::new(\u0026repo_opts, \u0026backends)?.init(\u0026key_opts, \u0026config_opts)?;\n\n    // -\u003e use _repo for any operation on an open repository\n    Ok(())\n}\n```\n\n### Example: Creating a new snapshot\n\n```rust\nuse rustic_backend::BackendOptions;\nuse rustic_core::{BackupOptions, PathList, Repository, RepositoryOptions, SnapshotOptions};\nuse simplelog::{Config, LevelFilter, SimpleLogger};\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    // Display info logs\n    let _ = SimpleLogger::init(LevelFilter::Info, Config::default());\n\n    // Initialize Backends\n    let backends = BackendOptions::default()\n        .repository(\"/tmp/repo\")\n        .repo_hot(\"/tmp/repo2\")\n        .to_backends()?;\n\n    // Open repository\n    let repo_opts = RepositoryOptions::default().password(\"test\");\n\n    let repo = Repository::new(\u0026repo_opts, \u0026backends)?\n        .open()?\n        .to_indexed_ids()?;\n\n    let backup_opts = BackupOptions::default();\n    let source = PathList::from_string(\".\")?.sanitize()?;\n    let snap = SnapshotOptions::default()\n        .add_tags(\"tag1,tag2\")?\n        .to_snapshot()?;\n\n    // Create snapshot\n    let snap = repo.backup(\u0026backup_opts, \u0026source, snap)?;\n\n    println!(\"successfully created snapshot:\\n{snap:#?}\");\n    Ok(())\n}\n```\n\n### Example: Restoring a snapshot\n\n```rust\nuse rustic_backend::BackendOptions;\nuse rustic_core::{LocalDestination, LsOptions, Repository, RepositoryOptions, RestoreOptions};\nuse simplelog::{Config, LevelFilter, SimpleLogger};\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    // Display info logs\n    let _ = SimpleLogger::init(LevelFilter::Info, Config::default());\n\n    // Initialize Backends\n    let backends = BackendOptions::default()\n        .repository(\"/tmp/repo\")\n        .to_backends()?;\n\n    // Open repository\n    let repo_opts = RepositoryOptions::default().password(\"test\");\n    let repo = Repository::new(\u0026repo_opts, \u0026backends)?\n        .open()?\n        .to_indexed()?;\n\n    // use latest snapshot without filtering snapshots\n    let node = repo.node_from_snapshot_path(\"latest\", |_| true)?;\n\n    // use list of the snapshot contents using no additional filtering\n    let streamer_opts = LsOptions::default();\n    let ls = repo.ls(\u0026node, \u0026streamer_opts)?;\n\n    let destination = \"./restore/\"; // restore to this destination dir\n    let create = true; // create destination dir, if it doesn't exist\n    let dest = LocalDestination::new(destination, create, !node.is_dir())?;\n\n    let opts = RestoreOptions::default();\n    let dry_run = false;\n    // create restore infos. Note: this also already creates needed dirs in the destination\n    let restore_infos = repo.prepare_restore(\u0026opts, ls.clone(), \u0026dest, dry_run)?;\n\n    repo.restore(restore_infos, \u0026opts, ls, \u0026dest)?;\n    Ok(())\n}\n```\n\n### Example: Checking a repository\n\n```rust\nuse rustic_backend::BackendOptions;\nuse rustic_core::{CheckOptions, Repository, RepositoryOptions};\nuse simplelog::{Config, LevelFilter, SimpleLogger};\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    // Display info logs\n    let _ = SimpleLogger::init(LevelFilter::Info, Config::default());\n\n    // Initialize Backends\n    let backends = BackendOptions::default()\n        .repository(\"/tmp/repo\")\n        .to_backends()?;\n\n    // Open repository\n    let repo_opts = RepositoryOptions::default().password(\"test\");\n    let repo = Repository::new(\u0026repo_opts, \u0026backends)?.open()?;\n\n    // Check repository with standard options but omitting cache checks\n    let opts = CheckOptions::default().trust_cache(true);\n    repo.check(opts)?;\n    Ok(())\n}\n```\n\n## Contributing\n\nFound a bug?\n[Open an issue!](https://github.com/rustic-rs/rustic_core/issues/choose)\n\nGot an idea for an improvement? Don't keep it to yourself!\n\n- [Contribute fixes](https://github.com/rustic-rs/rustic_core/contribute) or new\n  features via a pull requests!\n\nPlease make sure, that you read the\n[contribution guide](https://rustic.cli.rs/docs/contributing-to-rustic.html).\n\n## Minimum Rust version policy\n\nThis crate's minimum supported `rustc` version is `1.88.0`.\n\nThe current policy is that the minimum Rust version required to use this crate\ncan be increased in minor version updates. For example, if `crate 1.0` requires\nRust 1.20.0, then `crate 1.0.z` for all values of `z` will also require Rust\n1.20.0 or newer. However, `crate 1.y` for `y \u003e 0` may require a newer minimum\nversion of Rust.\n\nIn general, this crate will be conservative with respect to the minimum\nsupported version of Rust.\n\n## License\n\nLicensed under either of:\n\n- [Apache License, Version 2.0](./LICENSE-APACHE)\n- [MIT license](./LICENSE-MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustic-rs%2Frustic_core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustic-rs%2Frustic_core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustic-rs%2Frustic_core/lists"}