]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
4 years agosrc/bin/proxmox-backup-client.rs: implement login/logout
Dietmar Maurer [Sat, 10 Aug 2019 07:12:17 +0000 (09:12 +0200)]
src/bin/proxmox-backup-client.rs: implement login/logout

4 years agopxar: add command 'mount' to cli of pxar
Christian Ebner [Thu, 8 Aug 2019 10:49:20 +0000 (12:49 +0200)]
pxar: add command 'mount' to cli of pxar

Allows to mount an archive to a specified mountpoint via the cli.
Once the archive is mounted, the process is send to the background.
By passing the --verbose flag, the process is kept in foreground and
debug output is provided.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: add fuse module and expose its pub functionality.
Dietmar Maurer [Fri, 9 Aug 2019 14:45:13 +0000 (16:45 +0200)]
pxar: add fuse module and expose its pub functionality.

4 years agopxar: add basic code for FUSE implementation.
Christian Ebner [Thu, 8 Aug 2019 10:49:18 +0000 (12:49 +0200)]
pxar: add basic code for FUSE implementation.

This adds the basic code in order to create a fuse session and mount an archive.
It adds libfuse3-3 as runtime dependency and libfuse3-dev as build dependency.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/backup/data_blob.rs: define const MAX_BLOB_SIZE
Dietmar Maurer [Fri, 9 Aug 2019 09:49:06 +0000 (11:49 +0200)]
src/backup/data_blob.rs: define const MAX_BLOB_SIZE

4 years agosrc/bin/proxmox-backup-client.rs: implement catalog command
Dietmar Maurer [Fri, 9 Aug 2019 09:34:47 +0000 (11:34 +0200)]
src/bin/proxmox-backup-client.rs: implement catalog command

4 years agosrc/bin/proxmox-backup-client.rs: add archive filename to catalog
Dietmar Maurer [Fri, 9 Aug 2019 09:03:24 +0000 (11:03 +0200)]
src/bin/proxmox-backup-client.rs: add archive filename to catalog

4 years agosrc/backup/data_blob.rs: allow largert blob sizes (128MB)
Dietmar Maurer [Fri, 9 Aug 2019 08:22:56 +0000 (10:22 +0200)]
src/backup/data_blob.rs: allow largert blob sizes (128MB)

Need this for catalog files.

4 years agosrc/bin/proxmox-backup-client.rs: avoid compiler warning
Dietmar Maurer [Fri, 9 Aug 2019 08:22:32 +0000 (10:22 +0200)]
src/bin/proxmox-backup-client.rs: avoid compiler warning

4 years agosrc/bin/proxmox-backup-client.rs: new completion helper for snapshots
Dietmar Maurer [Fri, 9 Aug 2019 08:08:45 +0000 (10:08 +0200)]
src/bin/proxmox-backup-client.rs: new completion helper for snapshots

4 years agosrc/pxar/encoder.rs: use BackupCatalogWriter
Dietmar Maurer [Fri, 9 Aug 2019 07:46:49 +0000 (09:46 +0200)]
src/pxar/encoder.rs: use BackupCatalogWriter

4 years agosrc/pxar/catalog.rs: new catalog helper
Dietmar Maurer [Fri, 9 Aug 2019 06:11:32 +0000 (08:11 +0200)]
src/pxar/catalog.rs: new catalog helper

4 years agosrc/bin/proxmox-backup-client.rs: avoid doubled file extensions (.blob.blob) in index...
Dietmar Maurer [Wed, 7 Aug 2019 08:23:08 +0000 (10:23 +0200)]
src/bin/proxmox-backup-client.rs: avoid doubled file extensions (.blob.blob) in index.json

4 years agoapi: always use complete file names (including add exctensions)
Dietmar Maurer [Wed, 7 Aug 2019 08:10:14 +0000 (10:10 +0200)]
api: always use complete file names (including add exctensions)

4 years agosrc/api2/admin/datastore.rs - list_snapshot_files: list all files
Dietmar Maurer [Wed, 7 Aug 2019 07:16:14 +0000 (09:16 +0200)]
src/api2/admin/datastore.rs - list_snapshot_files: list all files

Add files that are not mentioned in index.json.

4 years agosrc/api2/backup/environment.rs - add_blob: always verify blob crc
Dietmar Maurer [Wed, 7 Aug 2019 07:15:13 +0000 (09:15 +0200)]
src/api2/backup/environment.rs - add_blob: always verify blob crc

4 years agosrc/backup/data_blob.rs - encode: always compute crc
Dietmar Maurer [Wed, 7 Aug 2019 06:29:38 +0000 (08:29 +0200)]
src/backup/data_blob.rs - encode: always compute crc

4 years agosrc/backup/backup_info.rs: add BackupInfo::new constructor
Dietmar Maurer [Wed, 7 Aug 2019 06:27:52 +0000 (08:27 +0200)]
src/backup/backup_info.rs: add BackupInfo::new constructor

4 years agosrc/bin/proxmox-backup-client.rs: fix remote filename completion
Dietmar Maurer [Wed, 7 Aug 2019 04:48:18 +0000 (06:48 +0200)]
src/bin/proxmox-backup-client.rs: fix remote filename completion

4 years agosrc/client/http_client.rs: compute checksums for chunk streams
Dietmar Maurer [Tue, 6 Aug 2019 10:23:06 +0000 (12:23 +0200)]
src/client/http_client.rs: compute checksums for chunk streams

4 years agosrc/client/http_client.rs: minor code cleanup
Dietmar Maurer [Tue, 6 Aug 2019 09:46:15 +0000 (11:46 +0200)]
src/client/http_client.rs: minor code cleanup

4 years agosrc/backup/data_blob.rs: always compute crc
Dietmar Maurer [Tue, 6 Aug 2019 09:42:14 +0000 (11:42 +0200)]
src/backup/data_blob.rs: always compute crc

4 years agosrc/client/http_client.rs: compute file checksums
Dietmar Maurer [Tue, 6 Aug 2019 09:26:06 +0000 (11:26 +0200)]
src/client/http_client.rs: compute file checksums

4 years agosrc/api2/admin/datastore.rs: extract backup size from index.json
Dietmar Maurer [Tue, 6 Aug 2019 08:56:21 +0000 (10:56 +0200)]
src/api2/admin/datastore.rs: extract backup size from index.json

4 years agopxar: add initial docs for MatchPattern
Christian Ebner [Mon, 5 Aug 2019 12:28:21 +0000 (14:28 +0200)]
pxar: add initial docs for MatchPattern

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: add error handling for MatchPattern::matches_filename()
Christian Ebner [Mon, 5 Aug 2019 12:28:03 +0000 (14:28 +0200)]
pxar: add error handling for MatchPattern::matches_filename()

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/api2/admin/datastore.rs - files: return data from index.json
Dietmar Maurer [Mon, 5 Aug 2019 11:22:19 +0000 (13:22 +0200)]
src/api2/admin/datastore.rs - files: return data from index.json

4 years agotests/worker-task-abort.rs: use proxmox::tools::try_block
Dietmar Maurer [Mon, 5 Aug 2019 08:04:12 +0000 (10:04 +0200)]
tests/worker-task-abort.rs: use proxmox::tools::try_block

4 years agouse new proxmox::tools::nodename
Dietmar Maurer [Sat, 3 Aug 2019 15:06:23 +0000 (17:06 +0200)]
use new proxmox::tools::nodename

4 years agoremove src/tools/common_regex.rs, use proxmox::tools::common_regex instead
Dietmar Maurer [Sat, 3 Aug 2019 14:44:31 +0000 (16:44 +0200)]
remove src/tools/common_regex.rs, use proxmox::tools::common_regex instead

4 years agoremove src/tools/procfs.rs, use proxmox::sys::linux::procfs instead
Dietmar Maurer [Sat, 3 Aug 2019 14:26:44 +0000 (16:26 +0200)]
remove src/tools/procfs.rs, use proxmox::sys::linux::procfs instead

4 years agosrc/tools/vec.rs: remove unused file
Dietmar Maurer [Sat, 3 Aug 2019 14:11:47 +0000 (16:11 +0200)]
src/tools/vec.rs: remove unused file

We already moved that to proxmox::tools

4 years agoupdate to nix 0.14, use code from proxmox:tools
Dietmar Maurer [Sat, 3 Aug 2019 11:05:38 +0000 (13:05 +0200)]
update to nix 0.14, use code from proxmox:tools

4 years agouse new proxmox::sys::linux::magic
Dietmar Maurer [Sat, 3 Aug 2019 07:28:57 +0000 (09:28 +0200)]
use new proxmox::sys::linux::magic

4 years agopxar: remove flag to change digest algorithm
Christian Ebner [Fri, 2 Aug 2019 15:43:25 +0000 (17:43 +0200)]
pxar: remove flag to change digest algorithm

The flag CA_FORMAT_SHA512_256 is used to switch between sha512 and sha256 to
calculate digest in casync.

As we use sha256, we can get rid of this flag for now.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: cleanup: refactor and rename exclude pattern
Christian Ebner [Fri, 2 Aug 2019 15:02:24 +0000 (17:02 +0200)]
pxar: cleanup: refactor and rename exclude pattern

The original name PxarExcludePattern makes no sense anymore as the patterns are
also used to match filenames during restore of the archive.

Therefore, exclude_pattern.rs is moved to match_pattern.rs and PxarExcludePattern
rename to MatchPattern.
Further, since it makes more sense the MatchTypes are now declared as None,
Positive, Negative, PartialPositive or PartialNegative, as this makes more sense
and seems more readable.
Positive matches are those without '!' prefix, Negatives with '!' prefix.

This makes also the filename matching in the encoder/decoder more intuitive and
the logic was adapted accordingly.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: cleanup: s/PxarDirBuf/PxarDirStack/g and move dir_buffer.rs to dir_stack.rs
Christian Ebner [Fri, 2 Aug 2019 13:19:36 +0000 (15:19 +0200)]
pxar: cleanup: s/PxarDirBuf/PxarDirStack/g and move dir_buffer.rs to dir_stack.rs

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: change uid and gid to u32 instead of u64
Christian Ebner [Fri, 2 Aug 2019 13:19:35 +0000 (15:19 +0200)]
pxar: change uid and gid to u32 instead of u64

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: cleanup: s/CA_FORMAT/PXAR/g and s/CaFormat/Pxar/g
Christian Ebner [Fri, 2 Aug 2019 13:19:34 +0000 (15:19 +0200)]
pxar: cleanup: s/CA_FORMAT/PXAR/g and s/CaFormat/Pxar/g

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: cleanup: move feature flags to src/pxar/flags.rs and omit CA_FORMAT prefix...
Christian Ebner [Fri, 2 Aug 2019 13:19:33 +0000 (15:19 +0200)]
pxar: cleanup: move feature flags to src/pxar/flags.rs and omit CA_FORMAT prefix on all of them

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: cleanup: move filesystem related magic numbers to tools/fs/magic.rs
Christian Ebner [Fri, 2 Aug 2019 13:19:32 +0000 (15:19 +0200)]
pxar: cleanup: move filesystem related magic numbers to tools/fs/magic.rs

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: sign index.json
Dietmar Maurer [Fri, 2 Aug 2019 08:00:15 +0000 (10:00 +0200)]
src/bin/proxmox-backup-client.rs: sign index.json

4 years agosrc/backup/data_blob.rs: implement signed blobs
Dietmar Maurer [Fri, 2 Aug 2019 07:56:01 +0000 (09:56 +0200)]
src/backup/data_blob.rs: implement signed blobs

4 years agosrc/backup/crypt_config.rs: new compute_auth_tag helper
Dietmar Maurer [Fri, 2 Aug 2019 06:55:37 +0000 (08:55 +0200)]
src/backup/crypt_config.rs: new compute_auth_tag helper

4 years agosrc/backup/crypt_config.rs: fix typo
Dietmar Maurer [Fri, 2 Aug 2019 06:29:40 +0000 (08:29 +0200)]
src/backup/crypt_config.rs: fix typo

4 years agopxar: implement feature flag support for device nodes, fifos and sockets
Christian Ebner [Thu, 1 Aug 2019 15:51:59 +0000 (17:51 +0200)]
pxar: implement feature flag support for device nodes, fifos and sockets

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: remove some unused feature flags from format definition
Christian Ebner [Thu, 1 Aug 2019 15:51:58 +0000 (17:51 +0200)]
pxar: remove some unused feature flags from format definition

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/sequential_decoder.rs: remove of obsolete function dir_mkdirat
Christian Ebner [Thu, 1 Aug 2019 14:23:49 +0000 (16:23 +0200)]
src/pxar/sequential_decoder.rs: remove of obsolete function dir_mkdirat

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/sequentail_decoder.rs: fix issue when restoring with glob pattern.
Christian Ebner [Thu, 1 Aug 2019 14:23:48 +0000 (16:23 +0200)]
src/pxar/sequentail_decoder.rs: fix issue when restoring with glob pattern.

Partial extraction of an archive with a glob pattern, e.g. '**/*.conf' lead to
the unexpected behaviour of restoring all partially matched directories (in this
example all of them).

This patch fixes this unexpected behaviour by only restoring those directories
were the directory or one of its sub-items fully matched the pattern and should
therefore be restored.

To achive this behavoiur, directory metadata is pushed onto a stack and restored
on demand.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/exclude_pattern.rs: add Clone and Copy trait to MatchType
Christian Ebner [Thu, 1 Aug 2019 14:23:47 +0000 (16:23 +0200)]
src/pxar/exclude_pattern.rs: add Clone and Copy trait to MatchType

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: add PxarDir and PxarDirBuf to buffer directory metadata
Christian Ebner [Thu, 1 Aug 2019 14:23:46 +0000 (16:23 +0200)]
pxar: add PxarDir and PxarDirBuf to buffer directory metadata

In order to restore only directories when some of their content fully matched
a match pattern on partial restores, these directories and their metadata are
pushed onto this buffer and only restored successivley on demand.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/format_definition.rs - PxarAttributes: derive Default
Dietmar Maurer [Fri, 2 Aug 2019 05:16:10 +0000 (07:16 +0200)]
src/pxar/format_definition.rs - PxarAttributes: derive Default

And remove unnecessary impl new().

4 years agosrc/pxar/sequential_decoder.rs: split read and restore of attributes into separate...
Christian Ebner [Thu, 1 Aug 2019 11:08:08 +0000 (13:08 +0200)]
src/pxar/sequential_decoder.rs: split read and restore of attributes into separate functions

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/format_definition.rs: add struct PxarAttributes
Christian Ebner [Thu, 1 Aug 2019 11:08:07 +0000 (13:08 +0200)]
src/pxar/format_definition.rs: add struct PxarAttributes

This structure contains all the attributes allowing to easily store those within
a e.g. dir buffer.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: avoid taking ownership of xattrs, fcaps and quota_projid on corresponding resto...
Christian Ebner [Thu, 1 Aug 2019 10:13:07 +0000 (12:13 +0200)]
pxar: avoid taking ownership of xattrs, fcaps and quota_projid on corresponding restore functions.

By borrowing these objects we preserve the functionality but make sure
that ownership doesn't change, avoiding problems when contained within other
structs such as e.g. a buffer storing these attributes.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: upload backup index.json
Dietmar Maurer [Thu, 1 Aug 2019 10:39:02 +0000 (12:39 +0200)]
src/bin/proxmox-backup-client.rs: upload backup index.json

The plan is to use this file to verify the backup content.

4 years agosrc/tools.rs - file_set_contents_full: only call fchmod when we pass permissions
Dietmar Maurer [Wed, 31 Jul 2019 10:44:27 +0000 (12:44 +0200)]
src/tools.rs - file_set_contents_full: only call fchmod when we pass permissions

So that we can use it to write into /etc/pve/ (which does not support chmod).

4 years agosrc/bin/proxmox-backup-client.rs - files: allow --repository parameter
Dietmar Maurer [Wed, 31 Jul 2019 09:45:55 +0000 (11:45 +0200)]
src/bin/proxmox-backup-client.rs - files: allow --repository parameter

4 years agosrc/bin/proxmox-backup-client.rs: implement files command
Dietmar Maurer [Wed, 31 Jul 2019 09:23:53 +0000 (11:23 +0200)]
src/bin/proxmox-backup-client.rs: implement files command

4 years agosrc/bin/proxmox-backup-client.rs: supress useless output from prune command
Dietmar Maurer [Wed, 31 Jul 2019 08:15:16 +0000 (10:15 +0200)]
src/bin/proxmox-backup-client.rs: supress useless output from prune command

4 years agopxar: add support for storing/restoring the quota project id on ZFS
Christian Ebner [Mon, 29 Jul 2019 15:21:35 +0000 (17:21 +0200)]
pxar: add support for storing/restoring the quota project id on ZFS

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: implement allow_existing_dirs for pxar decoder
Christian Ebner [Mon, 29 Jul 2019 12:01:45 +0000 (14:01 +0200)]
pxar: implement allow_existing_dirs for pxar decoder

By default, restoring an archive will fail if files with the same filename
already exist in the target directory.

By setting the allow_existing_dirs flag, the restore will not fail if an
existing directory is encountered.
The metadata (permissions, acls, ...) of the existing directory will be set
to the ones from the archive.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: add restore flag --allow-existing-dirs
Dietmar Maurer [Mon, 29 Jul 2019 10:49:15 +0000 (12:49 +0200)]
src/bin/proxmox-backup-client.rs: add restore flag --allow-existing-dirs

Not jet implemented ...

4 years agosrc/bin/proxmox-backup-client.rs: fixup - correctly pass prune parameters
Dietmar Maurer [Sat, 27 Jul 2019 07:24:23 +0000 (09:24 +0200)]
src/bin/proxmox-backup-client.rs: fixup - correctly pass prune parameters

4 years agosrc/api2/admin/datastore.rs: pass backup type/id (group) to prune
Dietmar Maurer [Sat, 27 Jul 2019 06:49:14 +0000 (08:49 +0200)]
src/api2/admin/datastore.rs: pass backup type/id (group) to prune

IMHO, prune over all backup groups is a bit dangerous, considering
that more than one user might use a datastore.

4 years agosrc/bin/proxmox-backup-client.rs: correctly compute duration
Dietmar Maurer [Fri, 26 Jul 2019 09:11:55 +0000 (11:11 +0200)]
src/bin/proxmox-backup-client.rs: correctly compute duration

And format time with SecondsFormat::Secs

4 years agosrc/api2/backup.rs: cleanup schema definitions
Dietmar Maurer [Fri, 26 Jul 2019 07:07:29 +0000 (09:07 +0200)]
src/api2/backup.rs: cleanup schema definitions

4 years agosrc/api2/backup.rs: new required backup-time parameter
Dietmar Maurer [Thu, 25 Jul 2019 11:44:01 +0000 (13:44 +0200)]
src/api2/backup.rs: new required backup-time parameter

The client should pass the time as parameter.

4 years agosrc/api2/admin/datastore.rs: backup logs may not be written twice
Dietmar Maurer [Thu, 25 Jul 2019 10:23:33 +0000 (12:23 +0200)]
src/api2/admin/datastore.rs: backup logs may not be written twice

4 years agosrc/api2/admin/datastore.rs: use correct .blob extension for log
Dietmar Maurer [Thu, 25 Jul 2019 10:22:50 +0000 (12:22 +0200)]
src/api2/admin/datastore.rs: use correct .blob extension for log

4 years agosrc/bin/proxmox-backup-client.rs: implement upload-log
Dietmar Maurer [Thu, 25 Jul 2019 10:18:15 +0000 (12:18 +0200)]
src/bin/proxmox-backup-client.rs: implement upload-log

4 years agosrc/client/http_client.rs: allow upload with parameters
Dietmar Maurer [Thu, 25 Jul 2019 10:17:35 +0000 (12:17 +0200)]
src/client/http_client.rs: allow upload with parameters

4 years agosrc/api2/admin/datastore.rs: add api to upload backup client log file
Dietmar Maurer [Thu, 25 Jul 2019 08:12:45 +0000 (10:12 +0200)]
src/api2/admin/datastore.rs: add api to upload backup client log file

4 years agosrc/bin/proxmox-backup-client.rs: allow to uploag .log files (as binary blobs)
Dietmar Maurer [Wed, 24 Jul 2019 11:07:02 +0000 (13:07 +0200)]
src/bin/proxmox-backup-client.rs: allow to uploag .log files (as binary blobs)

4 years agosrc/pxar/encoder.rs: add new skip_lost_and_found parameter
Dietmar Maurer [Wed, 24 Jul 2019 10:21:25 +0000 (12:21 +0200)]
src/pxar/encoder.rs: add new skip_lost_and_found parameter

4 years agopxar_backup_stream.rs: limit lock scope to avoid blocking forever
Dietmar Maurer [Wed, 24 Jul 2019 09:30:43 +0000 (11:30 +0200)]
pxar_backup_stream.rs: limit lock scope to avoid blocking forever

4 years agoremove debug output
Dietmar Maurer [Wed, 24 Jul 2019 07:33:52 +0000 (09:33 +0200)]
remove debug output

4 years agosrc/client/pxar_backup_stream.rs: correctly pass errors to stream
Dietmar Maurer [Wed, 24 Jul 2019 07:24:35 +0000 (09:24 +0200)]
src/client/pxar_backup_stream.rs: correctly pass errors to stream

4 years agosrc/pxar/encoder.rs: allow to pass list of devices
Dietmar Maurer [Wed, 24 Jul 2019 05:48:59 +0000 (07:48 +0200)]
src/pxar/encoder.rs: allow to pass list of devices

For better mount point include control...

4 years agoRevert previous, commit, use UTC RFC3339 without timezone (Z)
Dietmar Maurer [Mon, 22 Jul 2019 08:12:51 +0000 (10:12 +0200)]
Revert previous, commit, use UTC RFC3339 without timezone (Z)

We now have human readable data/time, and names are still sortable.

4 years agosrc/backup/backup_info.rs: use unix epoch timestamps instead of RFC3339
Dietmar Maurer [Mon, 22 Jul 2019 05:57:03 +0000 (07:57 +0200)]
src/backup/backup_info.rs: use unix epoch timestamps instead of RFC3339

RFC3339 contains additional timezone information, but IMHO this just adds
more confusion. The API also uses timestamps.

4 years agosrc/pxar/sequential_decoder.rs: Call callback only on restored paths.
Christian Ebner [Fri, 19 Jul 2019 08:55:28 +0000 (10:55 +0200)]
src/pxar/sequential_decoder.rs: Call callback only on restored paths.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/pxar.rs - extract: print archive name with --verbose flag
Dietmar Maurer [Fri, 19 Jul 2019 05:01:57 +0000 (07:01 +0200)]
src/bin/pxar.rs - extract: print archive name with --verbose flag

4 years agosrc/bin/pxar.rs: remove wrong debug message
Dietmar Maurer [Fri, 19 Jul 2019 05:00:17 +0000 (07:00 +0200)]
src/bin/pxar.rs: remove wrong debug message

4 years agosrc/bin/pxar.rs: allow to pass paths and match patterns as args to pxar extract
Christian Ebner [Thu, 18 Jul 2019 09:35:51 +0000 (11:35 +0200)]
src/bin/pxar.rs: allow to pass paths and match patterns as args to pxar extract

To improve usability it is now possible to directly pass paths or match patterns
as arguments to pxar extract to partially restore an archive.
The patterns provided via CLI are appended to the ones read from file by the
--files-from option in order to have priority over those.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/proxmox-backup-client.rs: code cleanup
Dietmar Maurer [Thu, 18 Jul 2019 11:16:32 +0000 (13:16 +0200)]
src/bin/proxmox-backup-client.rs: code cleanup

4 years agosrc/bin/proxmox-backup-client.rs - status: only print result[data]
Dietmar Maurer [Thu, 18 Jul 2019 07:52:11 +0000 (09:52 +0200)]
src/bin/proxmox-backup-client.rs - status: only print result[data]

4 years agosrc/api2/admin/datastore.rs: allow to list all snapshots
Dietmar Maurer [Thu, 18 Jul 2019 07:11:43 +0000 (09:11 +0200)]
src/api2/admin/datastore.rs: allow to list all snapshots

4 years agosrc/cli/command.rs: set exit status on error
Dietmar Maurer [Wed, 17 Jul 2019 11:40:10 +0000 (13:40 +0200)]
src/cli/command.rs: set exit status on error

4 years agosrc/bin/pxar.rs: add --files-from parameter to pxar extract
Christian Ebner [Tue, 16 Jul 2019 16:19:45 +0000 (18:19 +0200)]
src/bin/pxar.rs: add --files-from parameter to pxar extract

Allows to pass a list of match pattern to the pxar extract call by reading them
from file.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agopxar: Adapt SequentialDecoder::restore() calls to pass empty match pattern for full...
Christian Ebner [Tue, 16 Jul 2019 16:19:44 +0000 (18:19 +0200)]
pxar: Adapt SequentialDecoder::restore() calls to pass empty match pattern for full restore

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/sequential_decoder.rs: adapt code for partial restore by match pattern
Christian Ebner [Tue, 16 Jul 2019 16:19:43 +0000 (18:19 +0200)]
src/pxar/sequential_decoder.rs: adapt code for partial restore by match pattern

Allows to partially restore an archive by passing match patterns to the restore
function.
The whole restore is performed in sequential, therefore the whole archive has to
be read.
By wrapping the RawFd into an Option it can be controlled if the corresponding
part is restored (in case of Some(fd)) or if the Reader reads over it
without restore (in case of None).

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/sequential_decoder.rs: implement match_filename to match include pattern...
Christian Ebner [Tue, 16 Jul 2019 16:19:42 +0000 (18:19 +0200)]
src/pxar/sequential_decoder.rs: implement match_filename to match include pattern for partial restores

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/sequential_decoder.rs: Also check for nul bytes when reading the filename
Christian Ebner [Tue, 16 Jul 2019 16:19:41 +0000 (18:19 +0200)]
src/pxar/sequential_decoder.rs: Also check for nul bytes when reading the filename

Check if the filename does not contain invalid nul byes when reading it from the
archive.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agotests/pxar.rs: Change rsync options to --archive
Christian Ebner [Tue, 16 Jul 2019 11:19:51 +0000 (13:19 +0200)]
tests/pxar.rs: Change rsync options to --archive

By this the pxar integrity test checks for even more attributes such as a e.g.
correctly restored timestamp. See `man rsync` for details.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/sequential_decoder.rs: remove old comments and refactoring
Christian Ebner [Tue, 16 Jul 2019 11:19:50 +0000 (13:19 +0200)]
src/pxar/sequential_decoder.rs: remove old comments and refactoring

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/encoder.rs: refactoring of match_exclude_pattern()
Christian Ebner [Tue, 16 Jul 2019 11:19:49 +0000 (13:19 +0200)]
src/pxar/encoder.rs: refactoring of match_exclude_pattern()

match_exclude_pattern() does not need a '&mut self' reference to the encoder,
move it therefore out of the impl.
Further, this patch contains some naming and formatting cosmetics.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/encoder.rs: remove unneeded dir_count
Christian Ebner [Tue, 16 Jul 2019 11:19:48 +0000 (13:19 +0200)]
src/pxar/encoder.rs: remove unneeded dir_count

dir_count was used to track the number of directory entries to store in the
archive and bail if the maximum is exceeded.
As the number of entries is equally obtained from the list of the filenames to
include, use that one instead.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/pxar/exclude_pattern.rs: do not return partial matches for files
Christian Ebner [Tue, 16 Jul 2019 11:19:47 +0000 (13:19 +0200)]
src/pxar/exclude_pattern.rs: do not return partial matches for files

Partial matches make only sense for directories, files are always leafs of the
tree. Take this into account in order to avoid restoring of files which only
matched the front of a match pattern.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
4 years agosrc/bin/pxar.rs: Make pxar extract target optional
Christian Ebner [Tue, 16 Jul 2019 13:45:17 +0000 (15:45 +0200)]
src/bin/pxar.rs: Make pxar extract target optional

In order to improve usablity, the target on archive extraction will be the
current working directory by default.
A different target can be provided via the optional --target <PATH> parameter.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>