2022-04-15 10:24:56 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
use anyhow::{bail, Error};
|
|
|
|
|
2022-04-20 13:30:04 +00:00
|
|
|
use pbs_datastore::DataStore;
|
2022-04-15 10:24:56 +00:00
|
|
|
|
|
|
|
fn run() -> Result<(), Error> {
|
|
|
|
let base: PathBuf = match std::env::args().skip(1).next() {
|
|
|
|
Some(path) => path.into(),
|
|
|
|
None => bail!("no path passed"),
|
|
|
|
};
|
|
|
|
|
2022-04-20 13:30:04 +00:00
|
|
|
let store = unsafe { DataStore::open_path("", &base, None)? };
|
|
|
|
|
|
|
|
for group in store.iter_backup_groups()? {
|
2022-04-15 10:24:56 +00:00
|
|
|
let group = group?;
|
|
|
|
println!("found group {}", group);
|
|
|
|
|
2022-04-20 13:30:04 +00:00
|
|
|
for snapshot in group.iter_snapshots()? {
|
2022-04-15 10:24:56 +00:00
|
|
|
println!("\t{}", snapshot?);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
std::process::exit(match run() {
|
|
|
|
Ok(_) => 0,
|
|
|
|
Err(err) => {
|
|
|
|
eprintln!("error: {}", err);
|
|
|
|
1
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|