]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
5 years agoproxmox-backup-manager: add garbage collection cli
Dietmar Maurer [Fri, 4 Jan 2019 10:33:58 +0000 (11:33 +0100)]
proxmox-backup-manager: add garbage collection cli

5 years agofix bash completion binary names
Dietmar Maurer [Fri, 4 Jan 2019 10:12:46 +0000 (11:12 +0100)]
fix bash completion binary names

5 years agocleanup crate names
Dietmar Maurer [Fri, 4 Jan 2019 09:49:52 +0000 (10:49 +0100)]
cleanup crate names

5 years agorename backup-client to proxmox-backup-client
Dietmar Maurer [Fri, 4 Jan 2019 09:41:37 +0000 (10:41 +0100)]
rename backup-client to proxmox-backup-client

5 years agorename pbs to proxmox-backup-manager
Dietmar Maurer [Fri, 4 Jan 2019 09:39:32 +0000 (10:39 +0100)]
rename pbs to proxmox-backup-manager

5 years agobackup/chunk_store.rs: only use one directory level
Dietmar Maurer [Fri, 4 Jan 2019 09:35:22 +0000 (10:35 +0100)]
backup/chunk_store.rs: only use one directory level

5 years agomove admin API to /admin/ subfolder
Dietmar Maurer [Fri, 4 Jan 2019 09:32:27 +0000 (10:32 +0100)]
move admin API to /admin/ subfolder

5 years agobackup/archive_index.rs: pass correct size to unmap
Dietmar Maurer [Fri, 4 Jan 2019 08:28:41 +0000 (09:28 +0100)]
backup/archive_index.rs: pass correct size to unmap

5 years agobackup/image_index.rs: use little endian
Dietmar Maurer [Fri, 4 Jan 2019 07:45:04 +0000 (08:45 +0100)]
backup/image_index.rs: use little endian

5 years agocli::command: wrap usage errors in a UsageError
Wolfgang Bumiller [Thu, 3 Jan 2019 13:36:31 +0000 (14:36 +0100)]
cli::command: wrap usage errors in a UsageError

So we can distinguish them and show usage output
conditionally.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agocatar/encoder.rs: make sure we write all data with write_all()
Dietmar Maurer [Thu, 3 Jan 2019 14:47:32 +0000 (15:47 +0100)]
catar/encoder.rs: make sure we write all data with write_all()

5 years agochunker.rs: make sure chunk_size_avg is a power of two
Dietmar Maurer [Thu, 3 Jan 2019 14:10:54 +0000 (15:10 +0100)]
chunker.rs: make sure chunk_size_avg is a power of two

5 years agoimprove chunker speed (avoid modulo)
Dietmar Maurer [Thu, 3 Jan 2019 13:35:19 +0000 (14:35 +0100)]
improve chunker speed (avoid modulo)

5 years agoadd benchmark for chunker
Dietmar Maurer [Wed, 2 Jan 2019 18:16:55 +0000 (19:16 +0100)]
add benchmark for chunker

We get about 300MB/s - so this is still not fast enough

Note: This is quite slow with debug target, so please compile with --release

5 years agoimage_index.rs: verify file size
Dietmar Maurer [Wed, 2 Jan 2019 17:14:02 +0000 (18:14 +0100)]
image_index.rs: verify file size

5 years agoimplement garbage collection for .aidx files
Dietmar Maurer [Wed, 2 Jan 2019 13:27:04 +0000 (14:27 +0100)]
implement garbage collection for .aidx files

5 years agoimage_index.rs: verify header magic/version
Dietmar Maurer [Wed, 2 Jan 2019 12:13:13 +0000 (13:13 +0100)]
image_index.rs: verify header magic/version

5 years agofix typo
Dietmar Maurer [Wed, 2 Jan 2019 11:56:04 +0000 (12:56 +0100)]
fix typo

5 years agodisable debug code
Dietmar Maurer [Wed, 2 Jan 2019 11:55:18 +0000 (12:55 +0100)]
disable debug code

5 years agoarchive_index.rs: correctly write .aidx file
Dietmar Maurer [Wed, 2 Jan 2019 11:54:40 +0000 (12:54 +0100)]
archive_index.rs: correctly write .aidx file

5 years agoimage_index.rs: print stats
Dietmar Maurer [Wed, 2 Jan 2019 11:53:49 +0000 (12:53 +0100)]
image_index.rs: print stats

5 years agosrc/backup/archive_index.rs: use close() instead of flush()
Dietmar Maurer [Wed, 2 Jan 2019 10:02:56 +0000 (11:02 +0100)]
src/backup/archive_index.rs: use close() instead of flush()

Also pass a reference to the encoder.

5 years agosrc/backup/archive_index.rs: implement flush()
Dietmar Maurer [Mon, 31 Dec 2018 17:01:07 +0000 (18:01 +0100)]
src/backup/archive_index.rs: implement flush()

5 years agosrc/backup/archive_index.rs: first try
Dietmar Maurer [Mon, 31 Dec 2018 16:30:08 +0000 (17:30 +0100)]
src/backup/archive_index.rs: first try

5 years agocreate backup mod in backup.rs, improve docu
Dietmar Maurer [Mon, 31 Dec 2018 15:08:04 +0000 (16:08 +0100)]
create backup mod in backup.rs, improve docu

5 years agomove chunker.rs to backup/
Dietmar Maurer [Mon, 31 Dec 2018 14:46:16 +0000 (15:46 +0100)]
move chunker.rs to backup/

5 years agorc/catar/chunker.rs: first try
Dietmar Maurer [Mon, 31 Dec 2018 12:01:06 +0000 (13:01 +0100)]
rc/catar/chunker.rs: first try

5 years agoavoid compiler warnings
Dietmar Maurer [Mon, 31 Dec 2018 09:54:25 +0000 (10:54 +0100)]
avoid compiler warnings

5 years agoadd another catart test
Dietmar Maurer [Mon, 31 Dec 2018 09:22:39 +0000 (10:22 +0100)]
add another catart test

5 years agoadd catart test for goodbye table ordering
Dietmar Maurer [Mon, 31 Dec 2018 09:19:15 +0000 (10:19 +0100)]
add catart test for goodbye table ordering

5 years agosrc/catar/encoder.rs: correctly sort goodbye items by hash key
Dietmar Maurer [Mon, 31 Dec 2018 09:11:28 +0000 (10:11 +0100)]
src/catar/encoder.rs: correctly sort goodbye items by hash key

5 years agonew catar binary
Dietmar Maurer [Sun, 30 Dec 2018 17:01:20 +0000 (18:01 +0100)]
new catar binary

currently used for debugging

5 years agofix doc syntax
Dietmar Maurer [Sun, 30 Dec 2018 16:43:53 +0000 (17:43 +0100)]
fix doc syntax

5 years agocatar cleanups ...
Dietmar Maurer [Sun, 30 Dec 2018 16:32:52 +0000 (17:32 +0100)]
catar cleanups ...

5 years agobinary_search_tree.rs: fix docs
Dietmar Maurer [Sun, 30 Dec 2018 14:34:43 +0000 (15:34 +0100)]
binary_search_tree.rs: fix docs

5 years agoadd some integreation tests for catar (compare with casync output)
Dietmar Maurer [Sun, 30 Dec 2018 14:33:43 +0000 (15:33 +0100)]
add some integreation tests for catar (compare with casync output)

5 years agosrc/catar/encoder.rs: auto-resize file_copy_buffer, limit number of dirs
Dietmar Maurer [Sun, 30 Dec 2018 13:09:59 +0000 (14:09 +0100)]
src/catar/encoder.rs: auto-resize file_copy_buffer, limit number of dirs

5 years agoimprove catar docs
Dietmar Maurer [Sun, 30 Dec 2018 12:47:27 +0000 (13:47 +0100)]
improve catar docs

5 years agoadd a comment about posible improvements
Dietmar Maurer [Sat, 29 Dec 2018 18:43:25 +0000 (19:43 +0100)]
add a comment about posible improvements

5 years agosrc/catar/binary_search_tree.rs: add regression tests and fix one bug
Dietmar Maurer [Sat, 29 Dec 2018 17:32:03 +0000 (18:32 +0100)]
src/catar/binary_search_tree.rs: add regression tests and fix one bug

5 years agosrc/catar/binary_search_tree.rs: improve docu
Dietmar Maurer [Sat, 29 Dec 2018 16:38:50 +0000 (17:38 +0100)]
src/catar/binary_search_tree.rs: improve docu

5 years agosrc/catar/encoder.rs: cleanup, factor out write_goodbye_table
Dietmar Maurer [Sat, 29 Dec 2018 16:26:32 +0000 (17:26 +0100)]
src/catar/encoder.rs: cleanup, factor out write_goodbye_table

5 years agosrc/catar/encoder.rs: correctly sort goodby items
Dietmar Maurer [Sat, 29 Dec 2018 16:00:48 +0000 (17:00 +0100)]
src/catar/encoder.rs: correctly sort goodby items

5 years agouse external crate siphasher
Dietmar Maurer [Fri, 28 Dec 2018 18:50:07 +0000 (19:50 +0100)]
use external crate siphasher

Because std::hash::SipHasher is deprecated.

5 years agosrc/catar/encoder.rs: fix bug in file copy
Dietmar Maurer [Fri, 28 Dec 2018 14:02:02 +0000 (15:02 +0100)]
src/catar/encoder.rs: fix bug in file copy

5 years agosrc/catar/encoder.rs: fix symlinks
Dietmar Maurer [Fri, 28 Dec 2018 13:51:43 +0000 (14:51 +0100)]
src/catar/encoder.rs: fix symlinks

5 years agogetopt: cleanup: add trailing commas
Wolfgang Bumiller [Fri, 28 Dec 2018 13:25:05 +0000 (14:25 +0100)]
getopt: cleanup: add trailing commas

It is customary in rust to always use trailing commas. (also
suggested by rustfmt)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agogetopt: cleanup: don't condense 'if' statements too much
Wolfgang Bumiller [Fri, 28 Dec 2018 13:24:24 +0000 (14:24 +0100)]
getopt: cleanup: don't condense 'if' statements too much

In a language which enforces curly braces this looks weird
and rustfmt doesn't like it.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agogetopt: whitespace cleanup
Wolfgang Bumiller [Fri, 28 Dec 2018 13:20:45 +0000 (14:20 +0100)]
getopt: whitespace cleanup

to make rustfmt happy

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agosrc/catar/encoder.rs: fix binary format, write goodby table
Dietmar Maurer [Fri, 28 Dec 2018 13:26:05 +0000 (14:26 +0100)]
src/catar/encoder.rs: fix binary format, write goodby table

We still ned to sort the table (BST) ...

5 years agogetopt: condense nested match to reduce indentation
Wolfgang Bumiller [Fri, 28 Dec 2018 13:15:09 +0000 (14:15 +0100)]
getopt: condense nested match to reduce indentation

The `match value` statement is the only thing covering the
entire RawArgument::Option case. `rustfmt` suggests this
more condensed way of writing this case.

See the `git diff -w` of this patch:
|diff --git a/src/getopts.rs b/src/getopts.rs
|index 9755af2..4db4579 100644
|--- a/src/getopts.rs
|+++ b/src/getopts.rs
|@@ -72,8 +72,7 @@ pub fn parse_arguments<T: AsRef<str>>(
|             RawArgument::Separator => {
|                 break;
|             }
|-            RawArgument::Option { name, value } => {
|-                match value {
|+            RawArgument::Option { name, value } => match value {
|                 None => {
|                     let mut want_bool = false;
|                     let mut can_default = false;
|@@ -125,7 +124,6 @@ pub fn parse_arguments<T: AsRef<str>>(
|                     data.push((name, v));
|                 }
|             }
|-            }
|             RawArgument::Argument { value } => {
|                 rest.push(value);
|             }

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agogetopt: let parse_arguments() take a slice of AsRef<str>
Wolfgang Bumiller [Fri, 28 Dec 2018 13:04:16 +0000 (14:04 +0100)]
getopt: let parse_arguments() take a slice of AsRef<str>

We don't need the content to be owned strings, and we don't
need the list to be a Vec, since we only care about being
able to iterate through and copy out portions of the strings
we need, so take an &[T] where T: AsRef<str>.

This avoids .iter().map(to_string).collect() before calling
parse_arguments().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agogetopt: remove skip logic
Wolfgang Bumiller [Fri, 28 Dec 2018 12:59:44 +0000 (13:59 +0100)]
getopt: remove skip logic

The 'skip' variable was set to indicate that the "rest of
the args" is to be copied into the 'rest' vec. We can do
this directly and avoid the 'if' case in the loop
altogether.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agogetopt: indentation reduction
Wolfgang Bumiller [Fri, 28 Dec 2018 12:54:18 +0000 (13:54 +0100)]
getopt: indentation reduction

See the `git diff -w` output:
|diff --git a/src/getopts.rs b/src/getopts.rs
|index 6548a01..517cc37 100644
|--- a/src/getopts.rs
|+++ b/src/getopts.rs
|@@ -72,7 +72,10 @@ pub fn parse_arguments(
|     while pos < args.len() {
|         if skip {
|             rest.push(args[pos].clone());
|-        } else {
|+            pos += 1;
|+            continue;
|+        }
|+
|         match parse_argument(&args[pos]) {
|             RawArgument::Separator => {
|                 skip = true;
|@@ -135,7 +138,6 @@ pub fn parse_arguments(
|                 rest.push(value);
|             }
|         }
|-        }
|
|         pos += 1;
|     }

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoparse_arguments: work with utf8 bytes and reduce indentation
Wolfgang Bumiller [Fri, 28 Dec 2018 12:14:13 +0000 (13:14 +0100)]
parse_arguments: work with utf8 bytes and reduce indentation

We are only caring about '=' and '-' which are single-byte
codepoints, so there's no reason not to work on a byte
slice.

Also, some indentation reduction:

Transform
    if (a) {
        ...
        return A;
    }
    return B;
into
    if (!a)
        return B;
    return A;

and
    if (a)
        if (b)
            foo()
into
    if (a && b)
        return;

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agosrc/catar/encoder.rs: write filenames
Dietmar Maurer [Fri, 28 Dec 2018 10:48:47 +0000 (11:48 +0100)]
src/catar/encoder.rs: write filenames

5 years agosrc/catar/encoder.rs: write file data
Dietmar Maurer [Fri, 28 Dec 2018 09:44:12 +0000 (10:44 +0100)]
src/catar/encoder.rs: write file data

5 years agosrc/catar/encoder.rs: write entry and symlink data
Dietmar Maurer [Fri, 28 Dec 2018 08:55:26 +0000 (09:55 +0100)]
src/catar/encoder.rs: write entry and symlink data

5 years agomake map_struct functions public
Dietmar Maurer [Fri, 28 Dec 2018 07:04:46 +0000 (08:04 +0100)]
make map_struct functions public

5 years agocatar/encoder.rs: improve error handling
Dietmar Maurer [Fri, 28 Dec 2018 06:45:15 +0000 (07:45 +0100)]
catar/encoder.rs: improve error handling

5 years agocleanups, avoid compiler warnings
Dietmar Maurer [Fri, 28 Dec 2018 06:14:12 +0000 (07:14 +0100)]
cleanups, avoid compiler warnings

5 years agocatar/encoder: detect symlink and regular files
Dietmar Maurer [Thu, 27 Dec 2018 13:24:31 +0000 (14:24 +0100)]
catar/encoder: detect symlink and regular files

5 years agocatar/encoder.rs: first try
Dietmar Maurer [Thu, 27 Dec 2018 12:15:10 +0000 (13:15 +0100)]
catar/encoder.rs: first try

5 years agotimer: setup_timeout_handler cannot fail
Wolfgang Bumiller [Thu, 27 Dec 2018 09:36:05 +0000 (10:36 +0100)]
timer: setup_timeout_handler cannot fail

and if it does it panics anyway

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agobackup-client: allow to specify directories (prepare for catar backup)
Dietmar Maurer [Thu, 27 Dec 2018 09:11:11 +0000 (10:11 +0100)]
backup-client: allow to specify directories (prepare for catar backup)

5 years agostart implementing catar
Dietmar Maurer [Thu, 27 Dec 2018 08:22:23 +0000 (09:22 +0100)]
start implementing catar

5 years agonew helper map_struct and map_struct_mut
Dietmar Maurer [Thu, 27 Dec 2018 08:20:17 +0000 (09:20 +0100)]
new helper map_struct and map_struct_mut

5 years agocleanup: reduce compiler warnings
Dietmar Maurer [Tue, 25 Dec 2018 12:29:27 +0000 (13:29 +0100)]
cleanup: reduce compiler warnings

5 years agoremove outdated comment
Dietmar Maurer [Tue, 25 Dec 2018 12:24:50 +0000 (13:24 +0100)]
remove outdated comment

5 years agotouch_chunk: use libc::lutimensat
Dietmar Maurer [Tue, 25 Dec 2018 10:59:02 +0000 (11:59 +0100)]
touch_chunk: use libc::lutimensat

5 years agomove lookup_datastore() to backup/datastore.rs
Dietmar Maurer [Sat, 22 Dec 2018 16:37:25 +0000 (17:37 +0100)]
move lookup_datastore() to backup/datastore.rs

5 years agogather usage statistics during garbage collection
Dietmar Maurer [Sat, 22 Dec 2018 15:58:16 +0000 (16:58 +0100)]
gather usage statistics during garbage collection

5 years agoopen_file_locked: improve error message
Dietmar Maurer [Sat, 22 Dec 2018 14:59:55 +0000 (15:59 +0100)]
open_file_locked: improve error message

5 years agosweep_used_chunks: print percentage
Dietmar Maurer [Sat, 22 Dec 2018 14:39:05 +0000 (15:39 +0100)]
sweep_used_chunks: print percentage

5 years agouse openssl for faster hashing
Dietmar Maurer [Sat, 22 Dec 2018 13:31:59 +0000 (14:31 +0100)]
use openssl for faster hashing

5 years agochunk_store: reduce number of directories
Dietmar Maurer [Sat, 22 Dec 2018 13:04:05 +0000 (14:04 +0100)]
chunk_store: reduce number of directories

Else, scans everything takes too long ...

5 years agosrc/api3/datastore.rs: new file
Dietmar Maurer [Fri, 21 Dec 2018 12:38:41 +0000 (13:38 +0100)]
src/api3/datastore.rs: new file

5 years agouse return value (avoid compiler warning)
Dietmar Maurer [Fri, 21 Dec 2018 11:44:20 +0000 (12:44 +0100)]
use return value (avoid compiler warning)

5 years agofix mutability for chunk store
Dietmar Maurer [Fri, 21 Dec 2018 11:15:26 +0000 (12:15 +0100)]
fix mutability for chunk store

5 years agobackup-client: add optional chunk-size parameter
Dietmar Maurer [Fri, 21 Dec 2018 10:18:08 +0000 (11:18 +0100)]
backup-client: add optional chunk-size parameter

5 years agobackup-client: do not start garbage collection after backup
Dietmar Maurer [Fri, 21 Dec 2018 08:24:55 +0000 (09:24 +0100)]
backup-client: do not start garbage collection after backup

5 years agobackup-client: use 1M chunks, make chunk_size configurable
Dietmar Maurer [Fri, 21 Dec 2018 07:36:57 +0000 (08:36 +0100)]
backup-client: use 1M chunks, make chunk_size configurable

5 years agobackup-clinet: specify target file name
Dietmar Maurer [Thu, 20 Dec 2018 13:09:31 +0000 (14:09 +0100)]
backup-clinet: specify target file name

5 years agoadd test code to access static global state
Dietmar Maurer [Thu, 20 Dec 2018 13:03:42 +0000 (14:03 +0100)]
add test code to access static global state

5 years agouse proxmox-backup as package name
Dietmar Maurer [Thu, 20 Dec 2018 09:32:49 +0000 (10:32 +0100)]
use proxmox-backup as package name

5 years agofix tests
Dietmar Maurer [Wed, 19 Dec 2018 12:54:22 +0000 (13:54 +0100)]
fix tests

5 years agotry to improve error messages
Dietmar Maurer [Wed, 19 Dec 2018 12:40:26 +0000 (13:40 +0100)]
try to improve error messages

5 years agocleanups: avoid compiler warnings
Dietmar Maurer [Wed, 19 Dec 2018 11:49:23 +0000 (12:49 +0100)]
cleanups: avoid compiler warnings

5 years agocleanup - avoid too much indentation
Dietmar Maurer [Wed, 19 Dec 2018 11:40:26 +0000 (12:40 +0100)]
cleanup - avoid too much indentation

5 years agocleanup
Dietmar Maurer [Wed, 19 Dec 2018 11:30:37 +0000 (12:30 +0100)]
cleanup

5 years agoChunkStore::sweep_used_chunks - use openat to speedup directory walks
Dietmar Maurer [Wed, 19 Dec 2018 11:20:01 +0000 (12:20 +0100)]
ChunkStore::sweep_used_chunks - use openat to speedup directory walks

5 years agouse timers with a signal for file locking
Wolfgang Bumiller [Wed, 19 Dec 2018 10:08:57 +0000 (11:08 +0100)]
use timers with a signal for file locking

* rename lock_file -> open_file_locked,
* add lock_file as a function working on already-opened
  files
* change timeout types to std::time::Duration

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd tools::timer module
Wolfgang Bumiller [Wed, 19 Dec 2018 10:07:43 +0000 (11:07 +0100)]
add tools::timer module

This wraps POSIX timers via timer_create(2).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd rust standard .gitignore file
Wolfgang Bumiller [Wed, 19 Dec 2018 10:06:40 +0000 (11:06 +0100)]
add rust standard .gitignore file

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agomove lock_file to tools.rs
Dietmar Maurer [Wed, 19 Dec 2018 09:02:24 +0000 (10:02 +0100)]
move lock_file to tools.rs

5 years agoimpl sweep_used_chunks, first try
Dietmar Maurer [Wed, 19 Dec 2018 08:51:33 +0000 (09:51 +0100)]
impl sweep_used_chunks, first try

5 years agomove sweep_used_chunks to chunk_store
Dietmar Maurer [Tue, 18 Dec 2018 10:18:55 +0000 (11:18 +0100)]
move sweep_used_chunks to chunk_store

5 years agostart impl garbage collection
Dietmar Maurer [Tue, 18 Dec 2018 10:06:03 +0000 (11:06 +0100)]
start impl garbage collection

5 years agostart implementing DataStore
Dietmar Maurer [Mon, 17 Dec 2018 12:00:39 +0000 (13:00 +0100)]
start implementing DataStore

5 years agostart implementing ImageIndexReader
Dietmar Maurer [Sun, 16 Dec 2018 13:44:44 +0000 (14:44 +0100)]
start implementing ImageIndexReader