Commit Graph

45 Commits

Author SHA1 Message Date
Wolfgang Bumiller
33b8067b63 include binary name in --version output
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-02-06 15:24:06 +01:00
Filip Schauer
e4e5fec1f6 read args from environment variables as fallback
Use the same environment variables that are used by
proxmox-backup-client:
* PBS_REPOSITORY
* PBS_PASSWORD(|_FD|_FILE|_CMD)
* PBS_ENCRYPTION_PASSWORD(|_FD|_FILE|_CMD)

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2025-02-06 15:23:02 +01:00
Filip Schauer
615173c7b5 Add missing implementation of the --version option
This was left in the help text but was not implemented during the
transition from clap to picoargs in 80fb0a4a.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2025-02-06 15:22:57 +01:00
Filip Schauer
cafd76d1f3 fix #5994: wait for decompression processes to exit
Wait for zstd, lzop or zcat processes to exit when uploading a
compressed VMA file. This prevents these processes from lingering as
zombies. Also check the exit code of the processes, to detect potential
failures during decompression.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2025-02-06 15:18:31 +01:00
Filip Schauer
65cca800bf improve error message for unexpected end of VMA file
When a VMA file ends unexpectedly while reading the header, change the
error message from "failed to fill whole buffer" to "Unexpected end of
VMA file" for more clarity.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2025-02-06 15:18:11 +01:00
Wolfgang Bumiller
e70313bd4c bump submodule and update to packaged pbs-api-types
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-02-06 15:18:11 +01:00
Fabian Grünbichler
c095652aca bump version to 0.0.2
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-11-22 08:27:48 +01:00
Fabian Grünbichler
afe1d07b3a d/control: add missing chrono build dependency
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-11-22 08:23:11 +01:00
Fabian Grünbichler
1ef7d1071c update PBS to 3.2.11
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-11-22 08:21:08 +01:00
Filip Schauer
da19af157a log device upload progress as a percentage
Log the upload progress of a device as a percentage with log level info
every 1000 chunks.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-11-22 08:12:03 +01:00
Filip Schauer
51567bbfc2 use level-based logging instead of println
Use log level "info" by default and prevent spamming messages for every
single chunk uploaded. To re-enable these messages, set the RUST_LOG
environment variable to "debug".

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-11-22 08:12:03 +01:00
Filip Schauer
54ad876f25 add option to skip vmids whose backups failed to upload
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-11-22 08:12:03 +01:00
Filip Schauer
207b83fe4c add support for bulk import of a dump directory
When a path to a directory is provided in the vma_file argument, try to
upload all VMA backups in the directory. This also handles compressed
VMA files, notes and logs. If a vmid is specified with --vmid, only the
backups of that particular vmid are uploaded.

This is intended for use on a dump directory:

PBS_FINGERPRINT='PBS_FINGERPRINT' vma-to-pbs \
        --repository 'user@realm!token@server:port:datastore' \
        /var/lib/vz/dump

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-11-22 08:12:03 +01:00
Filip Schauer
8dafa525f6 remove hard coded values
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-11-04 13:57:54 +01:00
Filip Schauer
f48dd30f86 split BackupVmaToPbsArgs into PbsArgs and VmaBackupArgs
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-11-04 13:25:03 +01:00
Fabian Grünbichler
3c850b39a5 update submodule to PBS 3.2.8-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-10-29 11:50:44 +01:00
Fabian Grünbichler
68564034b3 update to current PBS master
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-09-04 11:21:12 +02:00
Filip Schauer
4a21ab435a bump proxmox-sys
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-09-04 09:52:27 +02:00
Filip Schauer
737aed9eec add support for notes and logs
Allow the user to specify a notes file and a log file to associate with
the backup

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-07-11 10:34:24 +02:00
Filip Schauer
2dd0dc023d pass args by reference to create_pbs_backup_task
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-07-11 10:34:24 +02:00
Filip Schauer
0d24b49bf4 bump proxmox-backup-qemu and proxmox-time
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-07-10 14:04:16 +02:00
Fabian Grünbichler
6f8e9b0286 move .cargo/config to .cargo/config.toml
the old location has been deprecated for a while, and rustc 1.78 will start to warn about it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 12:38:39 +02:00
Fabian Grünbichler
7e4d1459b1 build: properly use cargo wrapper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 10:42:01 +02:00
Fabian Grünbichler
2f3b92870a update to current proxmox-backup-qemu master
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 10:37:26 +02:00
Fabian Grünbichler
cafa0d9741 correctly handle optional string parameters
one of the downsides of going via the C API here - on has to be careful to no
accidentally drop CStrings while also wanting to use them via pointers..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-05-16 11:07:25 +02:00
Fabian Grünbichler
1e75997eaa encrypt: improve checks
reject invalid combinations (encryption requested, but no keyfile) and warn
about pitfalls (keyfile given, but encryption not requested).

also allow keyfiles without passwords, but add a hint in case prompting is not
possible but not password file was given.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-05-16 11:07:25 +02:00
Fabian Grünbichler
bff003d11d clippy fix
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-05-16 10:56:40 +02:00
Filip Schauer
9f97fb6002 fix unused compress and encrypt options
Pass compress and encrypt to proxmox_backup_new_ns instead of using
default values. This was an oversight in the initial commit 4446414b.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-05-16 10:24:28 +02:00
Fabian Grünbichler
fff4e3c1fc build: upload for PVE and PBS
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-23 10:18:04 +02:00
Fabian Grünbichler
afac2a6ce9 bump version to 0.0.1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-23 10:12:27 +02:00
Fabian Grünbichler
9602df9091 add --backup-time to allow import of archival data
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-23 10:03:42 +02:00
Fabian Grünbichler
e3ae976fd6 add namespace support
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-23 09:54:47 +02:00
Wolfgang Bumiller
b08ef85646 add debian packaging
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-04-11 14:38:23 +02:00
Filip Schauer
d460b25fe0 reformat command line arguments to kebab-case
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
80fb0a4a79 switch argument handling from clap to pico-args
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
715c658e0e makefile: remove reference to unused submodule
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
0ebe41e0ce refactor error handling
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
0d40a7001d add a fallback for the --fingerprint argument
Fallback to the PBS_FINGERPRINT environment variable if the
--fingerprint argument is not specified.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
68e1a2e7c8 add support for streaming the VMA file via stdin
This allows the user to stream a compressed VMA file directly to a PBS
without the need to extract it to an intermediate .vma file.

Example usage:

zstd -d --stdout vzdump.vma.zst | vma-to-pbs \
    --repository <auth_id@host:port:datastore> \
    --vmid 123 \
    --password-file pbs_password

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
4f66246a91 remove unnecessary "extern crate" declarations
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
329e95d8d1 bump proxmox-backup-qemu
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Filip Schauer
324e2f88d9 add the ability to provide credentials via files
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-09 14:51:20 +02:00
Wolfgang Bumiller
285019aaf5 bump proxmox-backup-qemu
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-05 11:49:49 +01:00
Wolfgang Bumiller
35a9fd8c0c cargo fmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-07 14:36:51 +01:00
Filip Schauer
4446414be2 Initial commit
Implement a tool to import VMA files into a Proxmox Backup Server

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2023-12-07 14:36:37 +01:00