-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into prompt_confirm_password
- Loading branch information
Showing
22 changed files
with
1,740 additions
and
1,464 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! `prune` example | ||
use rustic_core::{PruneOpts, Repository, RepositoryOptions}; | ||
use simplelog::{Config, LevelFilter, SimpleLogger}; | ||
|
||
fn main() { | ||
// Display info logs | ||
let _ = SimpleLogger::init(LevelFilter::Info, Config::default()); | ||
|
||
// Open repository | ||
let mut repo_opts = RepositoryOptions::default(); | ||
repo_opts.repository = Some("/tmp/repo".to_string()); | ||
repo_opts.password = Some("test".to_string()); | ||
let repo = Repository::new(&repo_opts).unwrap().open().unwrap(); | ||
|
||
let prune_opts = PruneOpts::default(); | ||
let prune_plan = repo.prune_plan(&prune_opts).unwrap(); | ||
println!("{:?}", prune_plan.stats); | ||
println!("to repack: {:?}", prune_plan.repack_packs()); | ||
// to run the plan uncomment this line: | ||
// prune_plan.do_prune(&repo, &prune_opts).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
pub mod cat; | ||
pub mod check; | ||
pub mod prune; | ||
pub mod repoinfo; | ||
pub mod snapshots; |
Oops, something went wrong.