runs a command at interval in foreground
version: 2023.531.1201 date: 2023-05-31 author: bestia.dev repository: Github
Hashtags: #rustlang #utility #cli
My projects on Github are more like a tutorial than a finished product: bestia-dev tutorials.
In Linux I love to use the screen command. In a screen session I can run a program
and detach with ctrl+a, d
.
The program will run indefinitely. With screen -r name
I can attach the session again and see
what is going on. And then detach again.
Watching the stdout of the program "in foreground" is easier then reading logs. This is from the viewpoint of a developer. I want to see my program how it works after every modification.
This is great for beta web servers. They need to run indefinitely.
For other tasks like fetching data every hour I need a scheduler. The scheduler will run indefinitely inside a screen. The fetch program will run for a few seconds every hour.
Run it with this arguments minute, command, args:
foreground_scheduler 4 cargo "crev repo fetch trusted"
This will run every hour at xx:04 minutes.
Documentation:
https://bestia-dev.github.io/foreground_scheduler
List of prepared automation tasks for development: build, run, doc, publish,...
cargo auto
My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻
//bestia.dev
//github.com/bestia-dev
//bestiadev.substack.com
//youtube.com/@bestia-dev-tutorials