mirror of https://github.com/dswd/zvault
Some fixes
This commit is contained in:
parent
336cc97fea
commit
2242100e6e
|
@ -107,7 +107,6 @@ Now I can backup my home directory to the repository.
|
||||||
|
|
||||||
#$> zvault backup /home/dswd/projects ::projects1
|
#$> zvault backup /home/dswd/projects ::projects1
|
||||||
info: No reference backup found, doing a full scan instead
|
info: No reference backup found, doing a full scan instead
|
||||||
Modified: false
|
|
||||||
Date: Thu, 6 Apr 2017 12:29:52 +0200
|
Date: Thu, 6 Apr 2017 12:29:52 +0200
|
||||||
Source: capanord:/home/dswd/projects
|
Source: capanord:/home/dswd/projects
|
||||||
Duration: 0:01:59.5
|
Duration: 0:01:59.5
|
||||||
|
@ -125,8 +124,7 @@ end my backup only uses 1.1 GiB out of 5.4 GiB.
|
||||||
After some work, I create another backup.
|
After some work, I create another backup.
|
||||||
|
|
||||||
#$> zvault backup /home/dswd/projects ::projects2
|
#$> zvault backup /home/dswd/projects ::projects2
|
||||||
info: Using backup projekte1 as reference
|
info: Using backup projects1 as reference
|
||||||
Modified: false
|
|
||||||
Date: Thu, 6 Apr 2017 13:28:54 +0200
|
Date: Thu, 6 Apr 2017 13:28:54 +0200
|
||||||
Source: capanord:/home/dswd/projects
|
Source: capanord:/home/dswd/projects
|
||||||
Duration: 0:00:07.9
|
Duration: 0:00:07.9
|
||||||
|
|
|
@ -7,5 +7,5 @@ Standards-Version: 3.8.3
|
||||||
|
|
||||||
Package: zvault
|
Package: zvault
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Depends: libsquash, ${shlibs:Depends}, ${misc:Depends}
|
Depends: libsodium18, libsquash, ${shlibs:Depends}, ${misc:Depends}
|
||||||
Description: Deduplicating backup solution
|
Description: Deduplicating backup solution
|
||||||
|
|
|
@ -238,7 +238,7 @@ pub fn parse() -> Result<Arguments, ErrorCode> {
|
||||||
.settings(&[AppSettings::AllowMissingPositional, AppSettings::VersionlessSubcommands, AppSettings::SubcommandRequiredElseHelp])
|
.settings(&[AppSettings::AllowMissingPositional, AppSettings::VersionlessSubcommands, AppSettings::SubcommandRequiredElseHelp])
|
||||||
.global_settings(&[AppSettings::UnifiedHelpMessage, AppSettings::ColoredHelp, AppSettings::ColorAuto])
|
.global_settings(&[AppSettings::UnifiedHelpMessage, AppSettings::ColoredHelp, AppSettings::ColorAuto])
|
||||||
.subcommand(SubCommand::with_name("init").about("Initialize a new repository")
|
.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("--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("-c --compression [COMPRESSION] 'Set the compression method and level (default: brotli/3)'"))
|
||||||
.arg(Arg::from_usage("-e --encrypt 'Generate a keypair and enable encryption'"))
|
.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'")))
|
.arg(Arg::from_usage("[REPO] 'The path for the new repository'")))
|
||||||
.subcommand(SubCommand::with_name("backup").about("Create a new backup")
|
.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("--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("[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("[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("-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("[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("[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("--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("<SRC> 'Source path to backup'"))
|
||||||
.arg(Arg::from_usage("<BACKUP> 'Backup path, [repository]::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("<OLD> 'Old version, [repository]::backup[::subpath]'"))
|
||||||
.arg(Arg::from_usage("<NEW> 'New 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")
|
.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("--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("-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'"))
|
.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'")))
|
.arg(Arg::from_usage("[FILE] 'Destination file for the keypair'")))
|
||||||
.subcommand(SubCommand::with_name("addkey").about("Add a key pair to the repository")
|
.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("-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("[FILE] 'File containing the keypair'").conflicts_with("generate"))
|
||||||
.arg(Arg::from_usage("[REPO] 'Path of the repository'")))
|
.arg(Arg::from_usage("[REPO] 'Path of the repository'")))
|
||||||
.subcommand(SubCommand::with_name("algotest").about("Test a specific algorithm combination")
|
.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("--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("-c --compression [COMPRESSION] 'Set the compression method and level (default: brotli/3)'"))
|
||||||
.arg(Arg::from_usage("-e --encryption 'Generate a keypair and enable encryption'"))
|
.arg(Arg::from_usage("-e --encryption 'Generate a keypair and enable encryption'"))
|
||||||
|
|
|
@ -122,7 +122,9 @@ fn find_reference_backup(repo: &Repository, path: &str) -> Result<Option<(String
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_backup(backup: &Backup) {
|
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!("Date: {}", Local.timestamp(backup.date, 0).to_rfc2822());
|
||||||
println!("Source: {}:{}", backup.host, backup.path);
|
println!("Source: {}:{}", backup.host, backup.path);
|
||||||
println!("Duration: {}", to_duration(backup.duration));
|
println!("Duration: {}", to_duration(backup.duration));
|
||||||
|
|
|
@ -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
|
/// filesystem may set, to change the way the file is opened. See fuse_file_info
|
||||||
/// structure in <fuse_common.h> for more details.
|
/// structure in <fuse_common.h> for more details.
|
||||||
fn open (&mut self, _req: &fuse::Request, ino: u64, flags: u32, reply: fuse::ReplyOpen) {
|
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 {
|
if (flags & (libc::O_WRONLY | libc::O_RDWR | libc::O_TRUNC) as u32) != 0 {
|
||||||
return reply.error(libc::EROFS);
|
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
|
/// operation. fh will contain the value set by the open method, or will be undefined
|
||||||
/// if the open method didn't set any value.
|
/// 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) {
|
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!(self, ino, reply);
|
||||||
let inode = inode.borrow();
|
let inode = inode.borrow();
|
||||||
match inode.inode.data {
|
match inode.inode.data {
|
||||||
|
|
|
@ -162,7 +162,7 @@ impl Default for Config {
|
||||||
Config {
|
Config {
|
||||||
compression: None,
|
compression: None,
|
||||||
encryption: None,
|
encryption: None,
|
||||||
bundle_size: 25,
|
bundle_size: 25*1024*1024,
|
||||||
chunker: ChunkerType::from_string("fastcdc/16").unwrap(),
|
chunker: ChunkerType::from_string("fastcdc/16").unwrap(),
|
||||||
hash: HashMethod::Blake2
|
hash: HashMethod::Blake2
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue