Some fixes

pull/10/head
Dennis Schwerdel 2017-04-06 13:39:24 +02:00
parent 336cc97fea
commit 2242100e6e
6 changed files with 25 additions and 27 deletions

View File

@ -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

View File

@ -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

View File

@ -238,7 +238,7 @@ pub fn parse() -> Result<Arguments, ErrorCode> {
.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<Arguments, ErrorCode> {
.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("<SRC> 'Source path to backup'"))
.arg(Arg::from_usage("<BACKUP> 'Backup path, [repository]::backup'")))
@ -301,7 +301,7 @@ pub fn parse() -> Result<Arguments, ErrorCode> {
.arg(Arg::from_usage("<OLD> 'Old version, [repository]::backup[::subpath]'"))
.arg(Arg::from_usage("<NEW> '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<Arguments, ErrorCode> {
.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'"))

View File

@ -122,7 +122,9 @@ fn find_reference_backup(repo: &Repository, path: &str) -> Result<Option<(String
}
fn print_backup(backup: &Backup) {
println!("Modified: {}", backup.modified);
if backup.modified {
warn!("This backup has been modified");
}
println!("Date: {}", Local.timestamp(backup.date, 0).to_rfc2822());
println!("Source: {}:{}", backup.host, backup.path);
println!("Duration: {}", to_duration(backup.duration));

View File

@ -373,7 +373,6 @@ impl<'a> fuse::Filesystem for FuseFilesystem<'a> {
/// filesystem may set, to change the way the file is opened. See fuse_file_info
/// structure in <fuse_common.h> 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 {

View File

@ -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
}