source code for client?

moofone

New Member
Apr 17, 2020
8
0
1
50
Hi,

I'm very interested in testing out the backup client for a number of servers mostly ubuntu 16.04/18.04. To be clear, to back up the linux file system (specific directories) to backup server (they are not running proxmox)

How can I get access to the source to build the client so I can evaluate?

Greg
 
Last edited:
Hi,

We host all of our sources over at: https://git.proxmox.com/
The Proxmox Backup Client and Server live in https://git.proxmox.com/?p=proxmox-backup.git;a=summary

Dominik and I already made a package for the Arch Linux user repo (AUR), we may see if we do an Ubuntu PPA in the future.
https://aur.archlinux.org/packages/proxmox-backup-client/
You could either go the same route as we went there and replace the packaged rust source dependencies with pointing directly to git,
or as you use Ubuntu, you could try using the devel repository deb http://download.proxmox.com/debian/devel/ buster main, install the build dependencies from there (they are mostly source only, so should work on both 16.04 and 18.04) and use the make deb target.
 
  • Like
Reactions: moofone
Hi Thomas,

Thank you for that. I went with the patch applied to master (commit 6fd129844dae9da6fa0b0729cad1953021ee2ada (HEAD -> master, origin/master, origin/HEAD))

I had to install libudev-dev and libapt-pkg-dev (just using apt install on ubuntu 18.04) but then I ran into this I'm on rustc 1.48.0-nightly (73dc675b9 2020-09-06)

Not sure its related, but in case it is, this is what apt installed for the following:

libapt-pkg-dev/bionic-updates,bionic-security,now 1.6.12ubuntu0.1 amd64 [installed]
libapt-pkg5.0/bionic-updates,bionic-security,now 1.6.12ubuntu0.1 amd64 [installed]

Cargo.toml has this after the patch applied
[dependencies]
apt-pkg-native = "0.3.1" # custom patched version

^ maybe this needs to point to a custom git also?

Code:
   Compiling proxmox v0.4.1 (git://git.proxmox.com/git/proxmox.git?rev=c0a376058ad4207b3672e56cfd9bcedc0e25a601#c0a37605)
   Compiling zstd-safe v1.4.13+zstd.1.4.3
   Compiling zstd v0.4.28+zstd.1.4.3
   Compiling proxmox-backup v0.8.19 (/tmp/proxmox-backup)
error[E0599]: no method named `priority_type` found for struct `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerIterator<'_>>` in the current scope
   --> src/api2/node/apt.rs:119:45
    |
119 |                     if let Some(prio) = ver.priority_type() {
    |                                             ^^^^^^^^^^^^^ method not found in `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerIterator<'_>>`

error[E0599]: no method named `short_desc` found for struct `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>` in the current scope
   --> src/api2/node/apt.rs:130:50
    |
130 |                         if let Some(sd) = origin.short_desc() {
    |                                                  ^^^^^^^^^^ method not found in `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>`

error[E0599]: no method named `long_desc` found for struct `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>` in the current scope
   --> src/api2/node/apt.rs:134:50
    |
134 |                         if let Some(ld) = origin.long_desc() {
    |                                                  ^^^^^^^^^ method not found in `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `proxmox-backup`.


If I use stable (rustc 1.43.1 (8d69840ab 2020-05-04)) instead of nightly the error is different:

Code:
   Compiling h2 v0.2.6
   Compiling futures v0.3.5
   Compiling pxar v0.6.1 (git://git.proxmox.com/git/pxar.git?rev=4f2d271a9608b576bf2dad22672a930285b5d7dd#4f2d271a)
   Compiling proxmox-fuse v0.1.0 (git://git.proxmox.com/git/proxmox-fuse.git#700f56b3)
   Compiling zstd-sys v1.4.13+zstd.1.4.3
   Compiling hyper v0.13.8
   Compiling handlebars v3.5.0
   Compiling proxmox v0.4.1 (git://git.proxmox.com/git/proxmox.git?rev=c0a376058ad4207b3672e56cfd9bcedc0e25a601#c0a37605)
   Compiling zstd-safe v1.4.13+zstd.1.4.3
   Compiling zstd v0.4.28+zstd.1.4.3
   Compiling proxmox-backup v0.8.19 (/tmp/proxmox-backup)
error[E0658]: use of unstable library feature 'str_strip': newly added
   --> src/server/worker_task.rs:234:66
    |
234 |             if let Some(rest) = iter.next().and_then(|rest| rest.strip_prefix("TASK ")) {
    |                                                                  ^^^^^^^^^^^^
    |
    = note: see issue #67302 <https://github.com/rust-lang/rust/issues/67302> for more information

error[E0599]: no method named `priority_type` found for struct `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerIterator<'_>>` in the current scope
   --> src/api2/node/apt.rs:119:45
    |
119 |                     if let Some(prio) = ver.priority_type() {
    |                                             ^^^^^^^^^^^^^ method not found in `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerIterator<'_>>`

error[E0599]: no method named `short_desc` found for struct `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>` in the current scope
   --> src/api2/node/apt.rs:130:50
    |
130 |                         if let Some(sd) = origin.short_desc() {
    |                                                  ^^^^^^^^^^ method not found in `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>`

error[E0599]: no method named `long_desc` found for struct `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>` in the current scope
   --> src/api2/node/apt.rs:134:50
    |
134 |                         if let Some(ld) = origin.long_desc() {
    |                                                  ^^^^^^^^^ method not found in `apt_pkg_native::citer::Borrowed<'_, apt_pkg_native::sane::VerFileIterator<'_>>`

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0599, E0658.
For more information about an error, try `rustc --explain E0599`.
error: could not compile `proxmox-backup`.

And after the patch this is what my Cargo.toml looks like:

Code:
root@epic1:/tmp/proxmox-backup# cat Cargo.toml
[package]
name = "proxmox-backup"
version = "0.8.19"
authors = ["Dietmar Maurer <dietmar@proxmox.com>"]
edition = "2018"
license = "AGPL-3"
description = "Proxmox Backup"
homepage = "https://www.proxmox.com"

exclude = [ "build", "debian", "tests/catar_data/test_symlink/symlink1"]

[lib]
name = "proxmox_backup"
path = "src/lib.rs"

[dependencies]
apt-pkg-native = "0.3.1" # custom patched version
base64 = "0.12"
bitflags = "1.2.1"
bytes = "0.5"
crc32fast = "1"
endian_trait = { version = "0.6", features = ["arrays"] }
anyhow = "1.0"
futures = "0.3"
h2 = { version = "0.2", features = ["stream"] }
handlebars = "3.0"
http = "0.2"
hyper = "0.13.6"
lazy_static = "1.4"
libc = "0.2"
log = "0.4"
nix = "0.16"
num-traits = "0.2"
once_cell = "1.3.1"
openssl = "0.10"
pam = "0.7"
pam-sys = "0.5"
percent-encoding = "2.1"
pin-utils = "0.1.0"
pathpatterns = { version = "0.1.2", git = "git://git.proxmox.com/git/pathpatterns.git" }
proxmox = { version = "0.4.1", features = [ "sortable-macro", "api-macro" ], git = "git://git.proxmox.com/git/proxmox.git", rev = "c0a376058ad4207b3672e56cfd9bcedc0e25a601" }
#proxmox = { git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox", version = "0.1.2", features = [ "sortable-macro", "api-macro" ] }
#proxmox = { path = "../proxmox/proxmox", features = [ "sortable-macro", "api-macro" ] }
proxmox-fuse = { version = "0.1.0", git = "git://git.proxmox.com/git/proxmox-fuse.git" }
pxar = { version = "0.6.1", features = [ "tokio-io", "futures-io" ] , git = "git://git.proxmox.com/git/pxar.git", rev = "4f2d271a9608b576bf2dad22672a930285b5d7dd"}
#pxar = { path = "../pxar", features = [ "tokio-io", "futures-io" ] }
regex = "1.2"
rustyline = "6"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
siphasher = "0.3"
syslog = "4.0"
tokio = { version = "0.2.9", features = [ "blocking", "fs", "dns", "io-util", "macros", "process", "rt-threaded", "signal", "stream", "tcp", "time", "uds" ] }
tokio-openssl = "0.4.0"
tokio-util = { version = "0.3", features = [ "codec" ] }
tower-service = "0.3.0"
udev = ">= 0.3, <0.5"
url = "2.1"
#valgrind_request = { git = "https://github.com/edef1c/libvalgrind_request", version = "1.1.0", optional = true }
walkdir = "2"
xdg = "2.2"
zstd = { version = "0.4", features = [ "bindgen" ] }
nom = "5.1"

[features]
default = []
#valgrind = ["valgrind_request"]
 
Last edited:
Hi Thomas,

Some progress. Had to install more packages:
- compile libfuse3 manually (ubuntu 18 only has v2)
- libacl1-dev, libpam-dev, uuid-dev


but now getting this:

Code:
t/services/proxmox-backup/target/debug/deps/libhttpdate-ffb4b06f0807e82b.rlib" "/root/services/proxmox-backup/target/debug/deps/libsocket2-644ef3f6f76e5980.rlib" "/root/services/proxmox-backup/target/debug/deps/libtower_service-7dc3d5ccc64138b6.rlib" "/root/services/proxmox-backup/target/debug/deps/libhttp_body-096ae580d77132cf.rlib" "/root/services/proxmox-backup/target/debug/deps/libtokio-ee042a080227a4f3.rlib" "/root/services/proxmox-backup/target/debug/deps/libsignal_hook_registry-877a807bb7dbc7e0.rlib" "/root/services/proxmox-backup/target/debug/deps/libarc_swap-604431288701787a.rlib" "/root/services/proxmox-backup/target/debug/deps/libnum_cpus-2591a53b83fdc724.rlib" "/root/services/proxmox-backup/target/debug/deps/libmio_uds-aea0dd97c50d5297.rlib" "/root/services/proxmox-backup/target/debug/deps/libmio-b01e666641130b65.rlib" "/root/services/proxmox-backup/target/debug/deps/libiovec-0eaba4a6032092dc.rlib" "/root/services/proxmox-backup/target/debug/deps/libnet2-346df196644a2249.rlib" "/root/services/proxmox-backup/target/debug/deps/liblibc-892bd240d6876960.rlib" "/root/services/proxmox-backup/target/debug/deps/libpin_project_lite-274f98c5e2451ef3.rlib" "/root/services/proxmox-backup/target/debug/deps/libtracing-48fa09ef2debd7c9.rlib" "/root/services/proxmox-backup/target/debug/deps/libtracing_core-a7d1ec9b73765990.rlib" "/root/services/proxmox-backup/target/debug/deps/liblazy_static-7c0477ae3415ac1f.rlib" "/root/services/proxmox-backup/target/debug/deps/liblog-93951ff8e53c2b76.rlib" "/root/services/proxmox-backup/target/debug/deps/libcfg_if-b00c34326580381c.rlib" "/root/services/proxmox-backup/target/debug/deps/liburl-2357aa003b109126.rlib" "/root/services/proxmox-backup/target/debug/deps/libpercent_encoding-e676c97fbc74cd56.rlib" "/root/services/proxmox-backup/target/debug/deps/libidna-208f8cac6b1c0650.rlib" "/root/services/proxmox-backup/target/debug/deps/libunicode_normalization-ba87a969781bf165.rlib" "/root/services/proxmox-backup/target/debug/deps/libtinyvec-dcd4c5100ad6ba99.rlib" "/root/services/proxmox-backup/target/debug/deps/libunicode_bidi-81f7bca86d771a09.rlib" "/root/services/proxmox-backup/target/debug/deps/libmatches-84413336e46be589.rlib" "/root/services/proxmox-backup/target/debug/deps/libserde_json-5c32c9b4c00e1c13.rlib" "/root/services/proxmox-backup/target/debug/deps/libryu-49c6c0501005e538.rlib" "/root/services/proxmox-backup/target/debug/deps/libserde-3d0487df557d45f8.rlib" "/root/services/proxmox-backup/target/debug/deps/libhttp-6d32a6a81c1835d6.rlib" "/root/services/proxmox-backup/target/debug/deps/libitoa-249c7ebdf9af9cde.rlib" "/root/services/proxmox-backup/target/debug/deps/libbytes-0d8dfbae79e026a0.rlib" "/root/services/proxmox-backup/target/debug/deps/libfnv-4e1f361c8239009e.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures-311c255c795d4d16.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_executor-b1e1c3e9d107f28d.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_util-65e6e166474d370d.rlib" "/root/services/proxmox-backup/target/debug/deps/libmemchr-1e6b68a09fbeab95.rlib" "/root/services/proxmox-backup/target/debug/deps/libproc_macro_nested-ba97d7debe3c50a9.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_io-9995fa9b12e498c0.rlib" "/root/services/proxmox-backup/target/debug/deps/libslab-3a7649c6fb4d320f.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_channel-56d0c5eaa17dfe40.rlib" "/root/services/proxmox-backup/target/debug/deps/libpin_project-e206ab917d8bb002.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_sink-32a3a25231d60339.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_task-4a6d11b862f56297.rlib" "/root/services/proxmox-backup/target/debug/deps/libonce_cell-385f84caecd78d24.rlib" "/root/services/proxmox-backup/target/debug/deps/libpin_utils-3bd6c621041b4748.rlib" "/root/services/proxmox-backup/target/debug/deps/libfutures_core-faf2a4809cbaf326.rlib" "/root/services/proxmox-backup/target/debug/deps/libanyhow-44df969aa9e20fb0.rlib" "-Wl,--start-group" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-edfba68bd3501617.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-cb36837ea2d84c1b.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-637cb1b53c807e95.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-099cf0af4375543b.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-b5f18e83369ef257.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3bb19daa4485d5fe.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-5298ab0591e7fb29.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-2e4947d254d0b599.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-1532436f783b0405.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-3d12d76f5782439f.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-f54fb6b93a192d72.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-d41f1ff31e4e0f27.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-108e5e911ebb4fc8.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-31288459e6a43502.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-c52e5d6301e1bd59.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-2675a9a46b5cec89.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f51baad7bbcb81c4.rlib" "-Wl,-Bdynamic" "-lacl" "-lcrypt" "-lpam" "-lpam_misc" "-ludev" "-lfuse3" "-lrt" "-lc" "-luuid" "-lssl" "-lcrypto" "-lutil" "-ldl" "-lutil" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil"
  = note: /root/services/proxmox-backup/target/debug/deps/libproxmox_backup-7dd25a2a4e235ba5.rlib(proxmox_backup-7dd25a2a4e235ba5.4yf21rgcufl3z10.rcgu.o): In function `proxmox_backup::tools::daemon::Reloader::fork_restart::{{closure}}':
          /root/services/proxmox-backup/src/tools/daemon.rs:137: undefined reference to `sd_journal_stream_fd'
          /root/services/proxmox-backup/src/tools/daemon.rs:144: undefined reference to `sd_journal_stream_fd'
          /root/services/proxmox-backup/target/debug/deps/libproxmox_backup-7dd25a2a4e235ba5.rlib(proxmox_backup-7dd25a2a4e235ba5.5310zkq8lrssor3c.rcgu.o): In function `proxmox_backup::tools::daemon::systemd_notify':
          /root/services/proxmox-backup/src/tools/daemon.rs:313: undefined reference to `sd_notify'
          collect2: error: ld returned 1 exit status


EDIT: It actually built proxmox-backup-client, so it may be okay. I'll have to test it later to know for sure.

Is there any documentation on how to use this? I am not sure what [OPTIONS] are supposed to be for like.. status and to perform a backup

root@ice-prox-coins:~/services/proxmox-backup/target/debug# export LD_LIBRARY_PATH=/root/services/libfuse-fuse-3.9.3/build/lib
root@ice-prox-coins:~/services/proxmox-backup/target/debug# ./proxmox-backup-client
Error: no command specified.
Possible commands: backup, benchmark, catalog, files, forget, garbage-collect, help, key, list, login, logout, mount, prune, restore, snapshots, status, task, upload-log, version

Usage:

proxmox-backup-client backup {<backupspec>} [OPTIONS]
proxmox-backup-client benchmark [OPTIONS]
proxmox-backup-client catalog dump <snapshot> [OPTIONS]
proxmox-backup-client catalog shell <snapshot> <archive-name> [OPTIONS]
proxmox-backup-client files <snapshot> [OPTIONS]
proxmox-backup-client forget <snapshot> [OPTIONS]
proxmox-backup-client garbage-collect [OPTIONS]
proxmox-backup-client help [{<command>}] [OPTIONS]
proxmox-backup-client key change-passphrase [<path>] [OPTIONS]
proxmox-backup-client key create [<path>] [OPTIONS]
proxmox-backup-client key create-master-key
proxmox-backup-client key import-master-pubkey <path>
proxmox-backup-client list [OPTIONS]
proxmox-backup-client login [OPTIONS]
proxmox-backup-client logout [OPTIONS]
proxmox-backup-client mount <snapshot> <archive-name> <target> [OPTIONS]
proxmox-backup-client prune <group> [OPTIONS]
proxmox-backup-client restore <snapshot> <archive-name> <target> [OPTIONS]
proxmox-backup-client snapshots [<group>] [OPTIONS]
proxmox-backup-client status [OPTIONS]
proxmox-backup-client task list [OPTIONS]
proxmox-backup-client task log <upid> [OPTIONS]
proxmox-backup-client task stop <upid> [OPTIONS]
proxmox-backup-client upload-log <snapshot> <logfile> [OPTIONS]
proxmox-backup-client version [OPTIONS]
 
Last edited:
  • Like
Reactions: moofone

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!