Delay shell script to download files from the Internet, fail and try again

Suppose you use a repeat () to download a file is temporarily unavailable from the Internet, but this will be able to download files only need to wait a while. Methods as below: 

 

Call the custom function repeat

repeat wget -c http://www.example.com/software-0.1.tar.gz 

 

Custom function repeat

repeat() { while :; do $@ && return; sleep 30; done } 

  

Guess you like

Origin www.cnblogs.com/singsong-ss/p/11461654.html