unohup 0.1.0

A useful wrapper library for nohup
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use clap::Clap;
use std::process::Command;
use unohup::Opts;

fn main() -> anyhow::Result<()> {
    let opts = Opts::parse();

    let commands = format!(
        "nice -n {} nohup {} > {} 2>&1 &",
        opts.nice,
        opts.commands.join(" "),
        opts.log_file
    );

    Command::new("bash").arg("-c").arg(&commands).spawn()?;

    Ok(())
}