A list of servers naming server21, server 22, server 23 etc. This list of servers is separate for my environments.
Env1 has 3 server
Env2 has 5 serves
Env3 has 10 servers
Each server accesses application through which I want to invoke some method. So the URL for Env1 and Server21 in it would be : http://Server21/abc.click.clear etc.
Now I want to make a shell script which invokes all these methods by Env wise and then server wise. I know wget will do the invoking but I am unable to make out the structure of the script. Can someone help me put on this?
If I understand correctly, you want to run a wget on a specific url on each server, and each server is in one of three environments?
If the app is always the same then it's just a matter of a 'for' loop:
for environment in `cat ListofEnvironments.txt`
do
echo "Environment: ${environment}"
for server in `cat ListOfServersIn${environment}.txt`
do
echo " Server: ${server}"
wget -q -O "${server}_abc.click.clear-output.txt" "http://${server}/abc.click.clear"
done
done
Not tested, you might need some slight debug.
If you want to run in parrallel instead (faster but everything runs at once), just add a n ampersand ('&') to the end of the wget line.