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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Fallback to the PBS_FINGERPRINT environment variable if the
--fingerprint argument is not specified.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
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>