diff --git a/README.md b/README.md index 1cfaec2..1f0912f 100644 --- a/README.md +++ b/README.md @@ -105,18 +105,17 @@ I should now store this key pair in a safe location before I continue. Now I can backup my home directory to the repository. - #$> zvault backup /home/dswd/projects ::projects1 - info: No reference backup found, doing a full scan instead - Modified: false - Date: Thu, 6 Apr 2017 12:29:52 +0200 - Source: capanord:/home/dswd/projects - Duration: 0:01:59.5 - Entries: 29205 files, 9535 dirs - Total backup size: 5.4 GiB - Modified data size: 5.4 GiB - Deduplicated size: 3.2 GiB, 41.8% saved - Compressed size: 1.1 GiB in 48 bundles, 63.9% saved - Chunk count: 220410, avg size: 15.0 KiB + #$> zvault backup /home/dswd/projects ::projects1 + info: No reference backup found, doing a full scan instead + Date: Thu, 6 Apr 2017 12:29:52 +0200 + Source: capanord:/home/dswd/projects + Duration: 0:01:59.5 + Entries: 29205 files, 9535 dirs + Total backup size: 5.4 GiB + Modified data size: 5.4 GiB + Deduplicated size: 3.2 GiB, 41.8% saved + Compressed size: 1.1 GiB in 48 bundles, 63.9% saved + Chunk count: 220410, avg size: 15.0 KiB The backup run took about 2 minutes and by looking at the data, I see that deduplication saved over 40% and compression again saved over 60% so that in the @@ -125,8 +124,7 @@ end my backup only uses 1.1 GiB out of 5.4 GiB. After some work, I create another backup. #$> zvault backup /home/dswd/projects ::projects2 - info: Using backup projekte1 as reference - Modified: false + info: Using backup projects1 as reference Date: Thu, 6 Apr 2017 13:28:54 +0200 Source: capanord:/home/dswd/projects Duration: 0:00:07.9 diff --git a/deb/zvault/debian/control b/deb/zvault/debian/control index 6f687e9..e0925d0 100644 --- a/deb/zvault/debian/control +++ b/deb/zvault/debian/control @@ -7,5 +7,5 @@ Standards-Version: 3.8.3 Package: zvault Architecture: amd64 -Depends: libsquash, ${shlibs:Depends}, ${misc:Depends} +Depends: libsodium18, libsquash, ${shlibs:Depends}, ${misc:Depends} Description: Deduplicating backup solution diff --git a/src/cli/args.rs b/src/cli/args.rs index 57967b2..ddfd60b 100644 --- a/src/cli/args.rs +++ b/src/cli/args.rs @@ -238,7 +238,7 @@ pub fn parse() -> Result { .settings(&[AppSettings::AllowMissingPositional, AppSettings::VersionlessSubcommands, AppSettings::SubcommandRequiredElseHelp]) .global_settings(&[AppSettings::UnifiedHelpMessage, AppSettings::ColoredHelp, AppSettings::ColorAuto]) .subcommand(SubCommand::with_name("init").about("Initialize a new repository") - .arg(Arg::from_usage("bundle_size --bundle-size [SIZE] 'Set the target bundle size in MiB (default: 25)'")) + .arg(Arg::from_usage("[bundle_size] --bundle-size [SIZE] 'Set the target bundle size in MiB (default: 25)'")) .arg(Arg::from_usage("--chunker [CHUNKER] 'Set the chunker algorithm and target chunk size (default: fastcdc/16)'")) .arg(Arg::from_usage("-c --compression [COMPRESSION] 'Set the compression method and level (default: brotli/3)'")) .arg(Arg::from_usage("-e --encrypt 'Generate a keypair and enable encryption'")) @@ -247,11 +247,11 @@ pub fn parse() -> Result { .arg(Arg::from_usage("[REPO] 'The path for the new repository'"))) .subcommand(SubCommand::with_name("backup").about("Create a new backup") .arg(Arg::from_usage("--full 'Create a full backup without using a reference'")) - .arg(Arg::from_usage("reference --ref [REF] 'Base the new backup on this reference'").conflicts_with("full")) - .arg(Arg::from_usage("cross_device -x --xdev 'Allow to cross filesystem boundaries'")) + .arg(Arg::from_usage("[reference] --ref [REF] 'Base the new backup on this reference'").conflicts_with("full")) + .arg(Arg::from_usage("[cross_device] -x --xdev 'Allow to cross filesystem boundaries'")) .arg(Arg::from_usage("-e --exclude [PATTERN]... 'Exclude this path or file pattern'")) - .arg(Arg::from_usage("excludes_from --excludes-from [FILE] 'Read the list of excludes from this file'")) - .arg(Arg::from_usage("no_default_excludes --no-default-excludes 'Do not load the default excludes file'")) + .arg(Arg::from_usage("[excludes_from] --excludes-from [FILE] 'Read the list of excludes from this file'")) + .arg(Arg::from_usage("[no_default_excludes] --no-default-excludes 'Do not load the default excludes file'")) .arg(Arg::from_usage("--tar 'Read the source data from a tar file'").conflicts_with_all(&["reference", "exclude", "excludes_from"])) .arg(Arg::from_usage(" 'Source path to backup'")) .arg(Arg::from_usage(" 'Backup path, [repository]::backup'"))) @@ -301,7 +301,7 @@ pub fn parse() -> Result { .arg(Arg::from_usage(" 'Old version, [repository]::backup[::subpath]'")) .arg(Arg::from_usage(" 'New version, [repository]::backup[::subpath]'"))) .subcommand(SubCommand::with_name("config").about("Display or change the configuration") - .arg(Arg::from_usage("bundle_size --bundle-size [SIZE] 'Set the target bundle size in MiB (default: 25)'")) + .arg(Arg::from_usage("[bundle_size] --bundle-size [SIZE] 'Set the target bundle size in MiB (default: 25)'")) .arg(Arg::from_usage("--chunker [CHUNKER] 'Set the chunker algorithm and target chunk size (default: fastcdc/16)'")) .arg(Arg::from_usage("-c --compression [COMPRESSION] 'Set the compression method and level (default: brotli/3)'")) .arg(Arg::from_usage("-e --encryption [PUBLIC_KEY] 'The public key to use for encryption'")) @@ -311,11 +311,11 @@ pub fn parse() -> Result { .arg(Arg::from_usage("[FILE] 'Destination file for the keypair'"))) .subcommand(SubCommand::with_name("addkey").about("Add a key pair to the repository") .arg(Arg::from_usage("-g --generate 'Generate a new key pair'").conflicts_with("FILE")) - .arg(Arg::from_usage("set_default --default -d 'Set the key pair as default'")) + .arg(Arg::from_usage("[set_default] --default -d 'Set the key pair as default'")) .arg(Arg::from_usage("[FILE] 'File containing the keypair'").conflicts_with("generate")) .arg(Arg::from_usage("[REPO] 'Path of the repository'"))) .subcommand(SubCommand::with_name("algotest").about("Test a specific algorithm combination") - .arg(Arg::from_usage("bundle_size --bundle-size [SIZE] 'Set the target bundle size in MiB (default: 25)'")) + .arg(Arg::from_usage("[bundle_size] --bundle-size [SIZE] 'Set the target bundle size in MiB (default: 25)'")) .arg(Arg::from_usage("--chunker [CHUNKER] 'Set the chunker algorithm and target chunk size (default: fastcdc/16)'")) .arg(Arg::from_usage("-c --compression [COMPRESSION] 'Set the compression method and level (default: brotli/3)'")) .arg(Arg::from_usage("-e --encryption 'Generate a keypair and enable encryption'")) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 87bf607..134757d 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -122,7 +122,9 @@ fn find_reference_backup(repo: &Repository, path: &str) -> Result fuse::Filesystem for FuseFilesystem<'a> { /// filesystem may set, to change the way the file is opened. See fuse_file_info /// structure in for more details. fn open (&mut self, _req: &fuse::Request, ino: u64, flags: u32, reply: fuse::ReplyOpen) { - info!("open {:?}, flags: {:o}", ino, flags); if (flags & (libc::O_WRONLY | libc::O_RDWR | libc::O_TRUNC) as u32) != 0 { return reply.error(libc::EROFS); } @@ -390,7 +389,6 @@ impl<'a> fuse::Filesystem for FuseFilesystem<'a> { /// operation. fh will contain the value set by the open method, or will be undefined /// if the open method didn't set any value. fn read (&mut self, _req: &fuse::Request, ino: u64, _fh: u64, mut offset: u64, mut size: u32, reply: fuse::ReplyData) { - info!("read {:?}, offset {}, size {}", ino, offset, size); let inode = inode!(self, ino, reply); let inode = inode.borrow(); match inode.inode.data { diff --git a/src/repository/config.rs b/src/repository/config.rs index d8df65c..51e6c86 100644 --- a/src/repository/config.rs +++ b/src/repository/config.rs @@ -162,7 +162,7 @@ impl Default for Config { Config { compression: None, encryption: None, - bundle_size: 25, + bundle_size: 25*1024*1024, chunker: ChunkerType::from_string("fastcdc/16").unwrap(), hash: HashMethod::Blake2 }