-4

How can I run curl on multiple URLs example:

curl https://google.com/1 
curl https://google.com/2 
curl https://google.com/3 

I would like to automate curl every 60 seconds.

  • Hello @Martynas. Would you please clarify whether you would like to download all the URLs, and after 60 re-downloading all the URLs again, OR you would like to wait 60 seconds between each URL. Thanks for any clarification! – user88036 Sep 27 '18 at 13:15
0

Try the below,

1) Create file MultiCurl.sh

/usr/bin/curl "https://google.com/1"
/usr/bin/curl "https://google.com/2"
/usr/bin/curl "https://google.com/3"

2) Make it executable with chmod

chmod +x MultiCurl.sh

3) Added it in Cron Job

*/60 * * * * $Scriptpath/MultiCurl.sh
0

Alternatively, you can use the command wget with the flag --i. Put all the urls in a file list.txt, then run wget

cat list.txt
https://google.com/1 
https://google.com/2 
https://google.com/3 


wget --i ./list.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.