
curl
複数のURLで例を実行する方法:
curl https://google.com/1
curl https://google.com/2
curl https://google.com/3
curl
60秒ごとに自動化したいです。
答え1
次の方法を試してください。
1) MultiCurl.sh ファイルを生成します。
/usr/bin/curl "https://google.com/1"
/usr/bin/curl "https://google.com/2"
/usr/bin/curl "https://google.com/3"
2)chmodを使用して実行可能にします。
chmod +x MultiCurl.sh
3) Cron Jobに追加
*/60 * * * * $Scriptpath/MultiCurl.sh
答え2
wget
あるいは、フラグと一緒にコマンドを使用することもできます--input-file
。すべてのURLをファイルに入れて、list.txt
次を実行しますwget
。
~$ cat list.txt
https://google.com/1
https://google.com/2
https://google.com/3
~$ wget --input-file ./list.txt