I. UTILITIES MANAGEMENT

The reason for the scripts here is to manage the utilities shown on these web pages, on several 50/51 stations on different I/A systems.

The need arose when I got tired of not finding an script I needed because it was not copied to this machine. I had to look for that utility on several stations (we have about 40 now), and if I was lucky to found it, then I had to transfer it where I needed. Sometimes, the utility was lost because a full restore was made on the station. Several times I had to rewrite the utility again.

Finally I decided to spend some time devising a way to have ALL my utilities available on ALL stations. The method I designed for this purpose is as follows.

I designated an AW51B at the HL system, and connected to the company LAN, as the master station. If a new script was written on another machine, it should be transferred asap to the master station.

All scripts names and a brief description are in a file named INDEX. One line per script is used.

Whenever an script has been written or modified, I run my utility "xfr_all". This script will transfer all utilities described in INDEX to all our (9) 50/51 stations connected to the LAN. At that moment, I will have at least one station per node holding my scripts.

I run then an script similar to "xfr_2_hl" on each one of the isolated nodes, to propagate my scripts from that station to all the others in that node. After that, I have all my utilities (with the latest versions) available on all 50/51 stations.

I tried using rexec to run the scripts similar to xfr_2_hl from the same script xfr_all but I have not been successful so far. Any ideas?.


I1. TRANSFER UTILITIES TO ALL STATIONS CONNECTED TO LAN

Here you have mi utility "xfr_all". The script will extract the first word from each line of the file INDEX, and it will use them to build an input file for the ftp procedure.


I2. TRANSFER UTILITIES TO ALL STATIONS IN A NODE

The script "xfr_2_hl" is fairly similar to the previous one. It will transfer utilities described in INDEX, to 50/51 stations on the HL node.


I3. CHANGE MODE TO ALL UTILITIES

After the transfer is done, I noticed that if I tried to execute a new script, the system refused to do it because it was not executable. I could have typed:

chmod +x *
to convert all files in my directory /opt/ac to executables. I decided instead to write another script: changer for that purpose.

I used a similar approach as on xfr_all. The script will get the names from INDEX, and then it will start changing its mode to 447 (executable by the owner only).

From that time on, whenever the script refuses to run, I just type:

sh changer
and it will take care of the conversion of all utilities to executables.


I4. DELETE UTILITIES FROM ALL STATIONS CONNECTED TO LAN

One time I needed to delete my scripts from all stations because I renamed them to have no more than 8 letters. After the efforts on deleting the utilities in only two nodes, taking care not to delete data files, I decided to write an script for this purpose.

The script del_all will delete all utilities, named in file INDEX, from all stations connected to the LAN.

After one occasion when I almost lost all my scripts by deleting them by mistake, I decided to include a confirmation question in the script. You must always have a way to stop a dangerous process, don't you think?


I5. DELETE UTILITIES FROM ALL STATIONS IN A NODE

In a similar way, "del_hl" will delete only from stations on the HL node.



Index - Home


This page hosted by
Get your own Free Home Page