From 543614a33aad1646cbb25af323e8374c88912203 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 23 Dec 2020 11:02:24 +0200 Subject: feat: re-enable progress bars for backup and restore --- client.yaml | 2 +- src/cmd/backup.rs | 2 +- src/cmd/restore.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client.yaml b/client.yaml index da46287..2bc88a1 100644 --- a/client.yaml +++ b/client.yaml @@ -1,3 +1,3 @@ server_url: https://localhost:8888/chunks -root: /home/liw/pers/obnam/git/live +root: /home/liw/tmp/Foton log: obnam.log diff --git a/src/cmd/backup.rs b/src/cmd/backup.rs index 178684f..3303566 100644 --- a/src/cmd/backup.rs +++ b/src/cmd/backup.rs @@ -23,7 +23,7 @@ pub fn backup(config: &ClientConfig, buffer_size: usize) -> anyhow::Result<()> { // The fetching is in its own block so that the file handles // get closed and data flushed to disk. let mut gen = Generation::create(&dbname)?; - let progress = create_progress_bar(GUESS_FILE_COUNT, false); + let progress = create_progress_bar(GUESS_FILE_COUNT, true); progress.enable_steady_tick(100); gen.insert_iter(FsIterator::new(&config.root).map(|entry| { progress.inc(1); diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs index 791bebf..b4a8f2b 100644 --- a/src/cmd/restore.rs +++ b/src/cmd/restore.rs @@ -39,7 +39,7 @@ pub fn restore(config: &ClientConfig, gen_id: &str, to: &Path) -> anyhow::Result let gen = Generation::open(&dbname)?; info!("restore file count: {}", gen.file_count()); - let progress = create_progress_bar(gen.file_count(), false); + let progress = create_progress_bar(gen.file_count(), true); for (fileid, entry) in gen.files()? { restore_generation(&client, &gen, fileid, &entry, &to, &progress)?; } -- cgit v1.2.1