Crates.io | ruplicity |
lib.rs | ruplicity |
version | 0.2.2 |
source | src |
created_at | 2015-10-19 13:49:15.982289 |
updated_at | 2016-01-09 16:38:05.568372 |
description | Library to read duplicity backups |
homepage | |
repository | https://github.com/mbrt/ruplicity |
max_upload_size | |
id | 3251 |
size | 558,082 |
Rust library to explore duplicity backups.
Add the corresponding entry to your Cargo.toml
dependencies:
[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.
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/single_vol");
let backup = Backup::new(backend).unwrap();
for snapshot in backup.snapshots().unwrap() {
println!("Snapshot {}", snapshot.time().into_local_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.