mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-06-16 17:31:02 +00:00
bins: init cli logger
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
a3593c890e
commit
955aea8ae8
@ -801,6 +801,8 @@ fn options(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Error> {
|
fn main() -> Result<(), Error> {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let uid = nix::unistd::Uid::current();
|
let uid = nix::unistd::Uid::current();
|
||||||
|
|
||||||
let username = match nix::unistd::User::from_uid(uid)? {
|
let username = match nix::unistd::User::from_uid(uid)? {
|
||||||
|
@ -387,6 +387,8 @@ fn scan(param: Value) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Error> {
|
fn main() -> Result<(), Error> {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let uid = nix::unistd::Uid::current();
|
let uid = nix::unistd::Uid::current();
|
||||||
|
|
||||||
let username = match nix::unistd::User::from_uid(uid)? {
|
let username = match nix::unistd::User::from_uid(uid)? {
|
||||||
|
@ -1616,6 +1616,7 @@ impl ReadAt for BufferedDynamicReadAt {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
pbs_tools::setup_libc_malloc_opts();
|
pbs_tools::setup_libc_malloc_opts();
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let backup_cmd_def = CliCommand::new(&API_METHOD_CREATE_BACKUP)
|
let backup_cmd_def = CliCommand::new(&API_METHOD_CREATE_BACKUP)
|
||||||
.arg_param(&["backupspec"])
|
.arg_param(&["backupspec"])
|
||||||
|
@ -8,8 +8,8 @@ use serde_json::{json, Value};
|
|||||||
|
|
||||||
use proxmox_router::cli::{
|
use proxmox_router::cli::{
|
||||||
complete_file_name, default_table_format_options, format_and_print_result_full,
|
complete_file_name, default_table_format_options, format_and_print_result_full,
|
||||||
get_output_format, run_cli_command, CliCommand, CliCommandMap, CliEnvironment, ColumnConfig,
|
get_output_format, init_cli_logger, run_cli_command, CliCommand, CliCommandMap, CliEnvironment,
|
||||||
OUTPUT_FORMAT,
|
ColumnConfig, OUTPUT_FORMAT,
|
||||||
};
|
};
|
||||||
use proxmox_router::{http_err, HttpError};
|
use proxmox_router::{http_err, HttpError};
|
||||||
use proxmox_schema::api;
|
use proxmox_schema::api;
|
||||||
@ -530,6 +530,8 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let list_cmd_def = CliCommand::new(&API_METHOD_LIST)
|
let list_cmd_def = CliCommand::new(&API_METHOD_LIST)
|
||||||
.arg_param(&["snapshot", "path"])
|
.arg_param(&["snapshot", "path"])
|
||||||
.completion_cb("repository", complete_repository)
|
.completion_cb("repository", complete_repository)
|
||||||
|
@ -442,6 +442,8 @@ fn dump_archive(archive: String, verbose: bool) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
init_cli_logger("PXAR_LOG", "info");
|
||||||
|
|
||||||
let cmd_def = CliCommandMap::new()
|
let cmd_def = CliCommandMap::new()
|
||||||
.insert(
|
.insert(
|
||||||
"create",
|
"create",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use proxmox_router::{
|
use proxmox_router::{
|
||||||
cli::{run_cli_command, CliCommandMap, CliEnvironment},
|
cli::{init_cli_logger, run_cli_command, CliCommandMap, CliEnvironment},
|
||||||
RpcEnvironment,
|
RpcEnvironment,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -7,6 +7,8 @@ mod proxmox_backup_debug;
|
|||||||
use proxmox_backup_debug::*;
|
use proxmox_backup_debug::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let cmd_def = CliCommandMap::new()
|
let cmd_def = CliCommandMap::new()
|
||||||
.insert("inspect", inspect::inspect_commands())
|
.insert("inspect", inspect::inspect_commands())
|
||||||
.insert("recover", recover::recover_commands())
|
.insert("recover", recover::recover_commands())
|
||||||
|
@ -413,6 +413,8 @@ async fn get_versions(verbose: bool, param: Value) -> Result<Value, Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn run() -> Result<(), Error> {
|
async fn run() -> Result<(), Error> {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let cmd_def = CliCommandMap::new()
|
let cmd_def = CliCommandMap::new()
|
||||||
.insert("acl", acl_commands())
|
.insert("acl", acl_commands())
|
||||||
.insert("datastore", datastore_commands())
|
.insert("datastore", datastore_commands())
|
||||||
|
@ -989,6 +989,8 @@ async fn catalog_media(mut param: Value) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
let cmd_def = CliCommandMap::new()
|
let cmd_def = CliCommandMap::new()
|
||||||
.insert(
|
.insert(
|
||||||
"backup",
|
"backup",
|
||||||
|
@ -123,6 +123,8 @@ fn set_encryption(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Error> {
|
fn main() -> Result<(), Error> {
|
||||||
|
init_cli_logger("PBS_LOG", "info");
|
||||||
|
|
||||||
// check if we are user root or backup
|
// check if we are user root or backup
|
||||||
let backup_uid = pbs_config::backup_user()?.uid;
|
let backup_uid = pbs_config::backup_user()?.uid;
|
||||||
let backup_gid = pbs_config::backup_group()?.gid;
|
let backup_gid = pbs_config::backup_group()?.gid;
|
||||||
|
Loading…
Reference in New Issue
Block a user