|
Name:
rtegroups - A utility to automatically create ADAPS groups from a Districts real-time sites
Information:
ADAPS groups are a powerful tool for use in performing functions in ADAPS. Once common group that many users maintain is a group of all of the real-time sites in their District. In particular, a group of District real-time sites is useful for some of the scripts on this web site, such as Quickplot or RT.Editor. However, maintenance of a real-time group can be problematic because the group must be hand edited with every addition or deletion of a real-time station. This is especially the case when several different users have the same group, as each must be maintained separately or the new version must be copied between users with every change.
This script automatically creates groups from the real-time sites maintained by NWISWeb. The groups are specific to certain parameter codes, can be created for multiple users, and can be filtered by District (useful where multiple Districts share the same NWIS host.)
The information regarding the groups to create is pulled from a control file listing the group names, pcodes, and user ids.
The format of each line in the control file is:
group_name / pcode1 [pcode2 ...] / district_code user1 [user2 ...]
where the two slashes (required) separate the three categories.
If the word "ALL" or "All" or "all" instead of a parameter code, the group will be created with all real-time parameters.
For example, the line in the control file
stage / 00065 / 19 tom dick harry
will create a group called 'stage' under users 'tom' 'dick' and 'harry' containing all the real-time stage site/DDs for District 19. For the majority of users that only have one District on their NWIS host, using a district code of 0 (zero) will eliminate the district code screening and make the script run faster.
To install this script, simply download, put the script in any directory on your NWIS host, and make the script file executable (chmod +x filename). Then type the name of the script. The name of the control file can be passed to the script as an argument, or if it is missing it will be prompted for.
This script can be run by hand, or it could be put into a cron job to execute on a regular schedule to ensure that your groups as always up to date.
Script Language:
sh
Requirements:
Original Author(s): Joe Nielsen, OSW and Ed Fischer, Iowa District
Known Problems/Limitations/Need Improvements:
Scripts: