How do I setup two curl commands to execute at different times forever?

For example, I want to run one command every 10 seconds and the other command every 5 minutes. I can only get the first one to log properly to a text file. Below is the shell script I am working on:

echo "script Running. Press CTRL-C to stop the process..."
while sleep 10;
curl -s -I --http2 >> new.txt
echo "------------1st command--------------------"  >> logs.txt;
while sleep 300;
curl -s -I --http2
echo "-----------------------2nd command---------------------------" >> logs.txt;

Read more here:

Content Attribution

This content was originally published by mark0616 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: