0

I type sudo -i to proceed to edit commands of crontab.

I've written the following line inside the file of crontab.

@reboot cd /home/username/superuser && cargo run;

The following content is inside the main.rs of the normal cargo.

use std::fs;

fn main() {
    let data = "rust language";
    fs::write("/home/username/foo", data).expect("Unable to write file");
}

As I reboot my computer , actually the file foo was not generated in a directory.

What is(/are) cause(s)?

1 Answer 1

0

As only the objective is to execute a program file, then one can run the that file with crontab with @reboot /home/username/path/to/cargo/package/target/filename

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .