bash
cargo install tiny_scheduler
Or add this to your Cargo.toml
:
toml
[dependencies]
tiny_scheduler = "0.1.0"
```rust use tinyscheduler::executecommandinx_minutes;
fn main() { executecommandinxminutes("cargo install tiny_scheduler", 2); } ```
execute_command_in_x_minutes
Execute a command in x minutes using at
or schtasks
depending on the OS.
command
- The command to execute.minutes
- The amount of minutes to wait before executing the command.```rust use executecommandinxminutes::executecommandinxminutes;
executecommandinxminutes("cargo install cargo-update", 5).unwrap(); ```
This function will return an error if the command fails to execute.