3 # run command as ./refresh_service_status.sh http://gjb-www-3.cluster.lifesci.dundee.ac.uk:9507/jabaws/ServiceStatus 15 cached_service_status.html &
4 # the command starts executing, but continues to run forever
6 # Host URL $1 (example: http://gjb-www-3.cluster.lifesci.dundee.ac.uk:9507/jabaws/ServiceStatus)
7 # Host URL $1 (example: http://gjb-www-3.cluster.lifesci.dundee.ac.uk:9507/jabaws/PublicAnnualStat)
10 echo "Hostname needs to be passed as 1st argument! (example http://compbio.lifesci.dundee.ac.uk/jabaws/ServiceStatus)"
14 # Refresh Time $2 (minutes)
17 echo "Refresh Time (min) needs to be passed as 2nd argument! (example 15)"
21 # Output-file $3 (html) (example: cached_service_status.html)
22 # Output-file $3 (html) (example: cached_usage_statistics.html)
25 echo "Outputfile (html) needs to be passed as 3rd argument! (example: cached_service_status.html)"
29 # gets the file as a tmp
30 while :; do echo "Fetching from $1:" `date "+%d/%m/%Y %H:%M:%S"`; wget -q $1 -O "tmp_cache.html"; mv "tmp_cache.html" $3; sleep $2m; done