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)?