Last active
December 19, 2023 05:31
-
-
Save Antvirf/89ff778cd6612286f984d0ade6b29c2e to your computer and use it in GitHub Desktop.
ghettocron: periodic tasks in a container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghettocron() { | |
sleep_duration=$1 | |
echo "[ghettocron] task interval set to $sleep_duration" | |
while true; do | |
sleep $sleep_duration | |
echo "[ghettocron] running task at $(date)" | |
curl http://localhost:8000/do_thing/ > /dev/null | |
done | |
} | |
ghettocron 60 & # start ghettocron | |
./run_server.sh # start the main app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment