Rust library to explore duplicity backups.
Add the corresponding entry to your Cargo.toml
dependencies:
toml
[dependencies]
ruplicity = "0.2"
and add extern crate ruplicity
to your crate root.
Why I chose to implement a duplicity backup reader in Rust? What are the differencies with duplicity?
This library does not aim to replace duplicity, since it does not provide actual backup / restore functionalities, and it does not have the many backends duplicity has. However, feel free to contribute if you need them.
This example demonstrates the opening of a backup stored in a local directory, and printing the files present in each backup snapshot.
```rust extern crate ruplicity;
use ruplicity::Backup; use ruplicity::backend::local::LocalBackend; use ruplicity::time_utils::TimeDisplay;
fn main() { // use the local backend to open a path in the file system containing a backup let backend = LocalBackend::new("tests/backups/singlevol"); let backup = Backup::new(backend).unwrap(); for snapshot in backup.snapshots().unwrap() { println!("Snapshot {}", snapshot.time().intolocal_display()); println!("{}", snapshot.entries().unwrap()); } } ```
Check out the documentation for advanced usages and examples.
Contributions are welcome! There are lots of features still to be implemented. The most important are:
This crate is distributed under the MIT license. See LICENSE for details.
And for those who are wondering: Can you use this license even if duplicity project is licensed under GNU GPL v2? Yes, because this project does not take a single line of code of duplicity and I wanted a permissive license to ease the use of the crate.