shell脚本从Internet延时下载文件,失败并重试

假设你要用repeat()从Internet上下载一个暂时不可用的文件,不过这个文件只需要等一会 就能下载。方法如下: 

调用自定义函数repeat

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

自定义函数repeat

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

  

猜你喜欢

转载自www.cnblogs.com/singsong-ss/p/11461654.html