Skip to main content

build_kopia_command

Function build_kopia_command 

Source
pub fn build_kopia_command(kopia: &Path) -> Result<Command, String>
Expand description

Build a Command that runs the kopia binary, elevated to the kopia user if the current platform/user requires it (Linux only).

On non-Linux platforms or when no elevation is needed, this is just Command::new(kopia). On Linux with Elevation::Sudo, it returns sudo -u kopia -- <kopia>. Elevation::Skip is propagated as an Err whose message is the Skip reason.